Fix cyclo doc
This commit is contained in:
@ -13,7 +13,6 @@ import net.sourceforge.pmd.lang.java.ast.ASTConditionalAndExpression;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTConditionalOrExpression;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTExpression;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodOrConstructorDeclaration;
|
||||
import net.sourceforge.pmd.lang.java.ast.JavaNode;
|
||||
import net.sourceforge.pmd.lang.java.ast.JavaParserVisitor;
|
||||
import net.sourceforge.pmd.lang.java.metrics.JavaMetrics;
|
||||
import net.sourceforge.pmd.lang.java.metrics.api.JavaOperationMetricKey;
|
||||
@ -30,21 +29,26 @@ import net.sourceforge.pmd.lang.metrics.ResultOption;
|
||||
*
|
||||
* <p>The standard version of the metric complies with McCabe's original definition [3]:
|
||||
*
|
||||
* <ul> <li>+1 for every control flow statement ({@code if, case, catch, throw, do, while, for, break, continue}) and
|
||||
* <ul>
|
||||
* <li>+1 for every control flow statement ({@code if, case, catch, throw, do, while, for, break, continue}) and
|
||||
* conditional expression ({@code ? : }). Notice switch cases count as one, but not the switch itself: the point is that
|
||||
* a switch should have the same complexity value as the equivalent series of {@code if} statements. <li>{@code else},
|
||||
* {@code finally} and {@code default} don't count; <li>+1 for every boolean operator ({@code &&, ||}) in the guard
|
||||
* condition of a control flow statement. That's because Java has short-circuit evaluation semantics for boolean
|
||||
* operators, which makes every boolean operator kind of a control flow statement in itself. </ul>
|
||||
* a switch should have the same complexity value as the equivalent series of {@code if} statements.
|
||||
* <li>{@code else}, {@code finally} and {@code default} don't count;
|
||||
* <li>+1 for every boolean operator ({@code &&, ||}) in the guard condition of a control flow statement. That's because
|
||||
* Java has short-circuit evaluation semantics for boolean operators, which makes every boolean operator kind of a
|
||||
* control flow statement in itself.
|
||||
* </ul>
|
||||
*
|
||||
* <p>Version {@link CycloVersion#IGNORE_BOOLEAN_PATHS}: Boolean operators are not counted, which means that empty
|
||||
* fall-through cases in {@code switch} statements are not counted as well.
|
||||
*
|
||||
* <p>References:
|
||||
*
|
||||
* <ul> <li> [1] Lanza, Object-Oriented Metrics in Practice, 2005. <li> [2] McCabe, A Complexity Measure, in Proceedings
|
||||
* of the 2nd ICSE (1976). <li> [3] <a href="https://docs.sonarqube.org/display/SONAR/Metrics+-+Complexity">Sonarqube
|
||||
* online documentation</a> </ul>
|
||||
* <ul>
|
||||
* <li> [1] Lanza, Object-Oriented Metrics in Practice, 2005.
|
||||
* <li> [2] McCabe, A Complexity Measure, in Proceedings of the 2nd ICSE (1976).
|
||||
* <li> [3] <a href="https://docs.sonarqube.org/display/SONAR/Metrics+-+Complexity">Sonarqube online documentation</a>
|
||||
* </ul>
|
||||
*
|
||||
* @author Clément Fournier
|
||||
* @since June 2017
|
||||
|
Reference in New Issue
Block a user