while (a) if (b) c();counts as three statements.
do .. while
form.
See note 3.if (a) { ... } else if (b) { ... } else if (c) { ... } else ... }this metric does not take into account the nesting of
else
clauses.
Thus the above code will be given a nesting level of 1,
rather than 3, which is implied by the following
(actual) reading of the code.
if (a) { ... } else if (b) { ... } else if (c) { ... } else ... }See note 1. See note 4.
switch
statements, this metric
measures the complexity of a switch
statement as 1.
case
label as a separate node.
#define x(if, while, else) (if + while + else)will be miscounted as keywords occuring in the corresponding macro. Furthermore keywords generated during preprocessing, as in
#define WHILE(x) while(x) { #define WEND } WHILE (x) foo(); WENDwill not be counted as occuring in the corresponding C function.
Contents | « Previous Next (Shortcomings) » |