Next: Other gnatmetric Switches, Previous: Syntax Metrics Control, Up: Switches for gnatmetric
For a program unit that is an executable body (a subprogram body (including generic bodies), task body, entry body or a package body containing its own statement sequence ) gnatmetric computes the following complexity metrics:
The McCabe complexity metrics are defined in www.mccabe.com/pdf/nist235r.pdf
According to McCabe, both control statements and short-circuit control forms should be taken into account when computing cyclomatic complexity. For each body, we compute three metric values:
When computing cyclomatic and essential complexity, gnatmetric skips the code in the exception handlers and in all the nested program units.
By default, all the complexity metrics are computed and reported. For more finely-grained control you can use the following switches:
exit
statements as goto
s when
computing Essential Complexity