Metric for counting the (McCabe) Cyclomatic Complexity for methods and closure fields. The counting rules for Groovy:
1. Each method starts with a complexity count of one. 2. Add one to the complexity count for each occurrence of: if while for case catch && || ?: (ternary-operator) ?: (elvis-operator) ?. (null-check)Additional notes:
Type Params | Return Type | Name and description |
---|---|---|
|
MetricResult |
calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode) |
|
MetricResult |
calculate(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode) |
Methods inherited from class | Name |
---|---|
class AbstractMethodMetric |
applyToClosure, applyToMethod, calculate, calculate, calculateForClass |
class AbstractMetric |
applyToClass, applyToPackage, calculateForClass, calculateForPackage, createAggregateMetricResult, isNotAnInterface |