Fix cyclo doc

This commit is contained in:
oowekyala
2017-08-13 19:23:42 +02:00
parent b24edf9565
commit 7d126ab206

View File

@ -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.ASTConditionalOrExpression;
import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTExpression;
import net.sourceforge.pmd.lang.java.ast.ASTMethodOrConstructorDeclaration; 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.ast.JavaParserVisitor;
import net.sourceforge.pmd.lang.java.metrics.JavaMetrics; import net.sourceforge.pmd.lang.java.metrics.JavaMetrics;
import net.sourceforge.pmd.lang.java.metrics.api.JavaOperationMetricKey; 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]: * <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 * 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}, * a switch should have the same complexity value as the equivalent series of {@code if} statements.
* {@code finally} and {@code default} don't count; <li>+1 for every boolean operator ({@code &&, ||}) in the guard * <li>{@code else}, {@code finally} and {@code default} don't count;
* condition of a control flow statement. That's because Java has short-circuit evaluation semantics for boolean * <li>+1 for every boolean operator ({@code &&, ||}) in the guard condition of a control flow statement. That's because
* operators, which makes every boolean operator kind of a control flow statement in itself. </ul> * 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 * <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. * fall-through cases in {@code switch} statements are not counted as well.
* *
* <p>References: * <p>References:
* *
* <ul> <li> [1] Lanza, Object-Oriented Metrics in Practice, 2005. <li> [2] McCabe, A Complexity Measure, in Proceedings * <ul>
* of the 2nd ICSE (1976). <li> [3] <a href="https://docs.sonarqube.org/display/SONAR/Metrics+-+Complexity">Sonarqube * <li> [1] Lanza, Object-Oriented Metrics in Practice, 2005.
* online documentation</a> </ul> * <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 * @author Clément Fournier
* @since June 2017 * @since June 2017