Nested if...else statements have a cyclomatic complexity of 4. Draw the control-flow graph: it includes 10 nodes (an entry and exit node for each statement, for a total of 6, plus 4 instructions) and 12 edges. There is a single component. Apply the cyclomatic complex formula:
M = 12 - 10 + 2 × 1 = 4
Read more