Skip to content

Commit

Permalink
Fix cyclo doc
Browse files Browse the repository at this point in the history
  • Loading branch information
oowekyala committed Aug 13, 2017
1 parent b24edf9 commit 7d126ab
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
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;
Expand All @@ -30,21 +29,26 @@
*
* <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
Expand Down

0 comments on commit 7d126ab

Please sign in to comment.