Closed mgalloy closed 11 years ago
r617 adds basic cyclomatic complexity calculations. There are user-defined limits with the COMPLEXITY_CUTOFFS
keyword. The complexity computation should be further refined because currently it will parse comments and string literals while also not counting CASE
and SWITCH
statements correctly.
There is a better IDL code parser now in the complexity calculation and modified cyclometric complexity is now computed as well. But to get the complexity right, a full IDL parser (or more heuristics) is needed because the :
indicating a case in a SWITCH
or CASE
statement is also used in the ternary operator, a label, and array indexing.
8e0dd398129bf66367794a170f11bf9a11d2ea63 adds bracket level as a heuristic to determine what type of :
is used. Problems with this approach:
GOTO
or ON_IOERROR
as a target to jump toThis is not perfect, but I think that a full IDL parser would not be worth it.
McCabe complexity statistics (McCabe cyclic, McCabe essential, McCabe modular design) were computed in the IDLdoc 2.0 code base. This functionality should be added to the IDLdoc 3.0 code base, though possibly in a simplified manner (i.e. reporting just one number).
Also, there should be user-defined limits for marking a routine as "complex" on the warnings page.
References for more information about the McCabe complexity statistics: