McCabe measures (among other things - there are a couple of measurements) code pathways.

Given a simple if statement with one condition there are 2 pathways - one if the statement is true, another if it is false.

However, given a if statement with two conditions there are 4 pathways.







con1 = true
con2 = true
con1 = false
con2 = true
con1 = true
con2 = false
con1 = false
con2 = false

Same measurement is used for while loops.

Case statements would have X + 1 conditions where X is the number of possible values the condition can switch on plus the default condition.