Metrics Checks |
![]() |
CyclomaticComplexityDescriptionChecks cyclomatic complexity against a specified limit. The complexity is measured by the number of if, while, do, for, ?:, catch, switch, case statements, and operators && and || (plus one) in the body of a constructor, method, static initializer, or instance initializer. It is a measure of the minimum number of possible paths through the source and therefore the number of required tests. Generally 1-4 is considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now! Properties
ExamplesTo configure the check:
<module name="CyclomaticComplexity"/>
To configure the check with a threshold of 7:
<module name="CyclomaticComplexity">
<property name="max" value="7"/>
</module>
Packagecom.puppycrawl.tools.checkstyle.checks.metrics Parent Module |
Copyright © 2002-2003 Oliver Burn. All rights Reserved.