Class CycloMetric
- java.lang.Object
-
- net.sourceforge.pmd.lang.metrics.AbstractMetric<N>
-
- net.sourceforge.pmd.lang.apex.metrics.AbstractApexMetric<ASTMethod>
-
- net.sourceforge.pmd.lang.apex.metrics.impl.AbstractApexOperationMetric
-
- net.sourceforge.pmd.lang.apex.metrics.impl.CycloMetric
-
- All Implemented Interfaces:
ApexOperationMetric,net.sourceforge.pmd.lang.metrics.Metric<ASTMethod>
public class CycloMetric extends AbstractApexOperationMetric
See the doc for the Java metric.- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description CycloMetric()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intbooleanExpressionComplexity(ASTStandardCondition expression)Computes the number of control flow paths through that expression, which is the number of||and&&operators.doublecomputeFor(ASTMethod node, net.sourceforge.pmd.lang.metrics.MetricOptions options)-
Methods inherited from class net.sourceforge.pmd.lang.apex.metrics.impl.AbstractApexOperationMetric
supports
-
-
-
-
Method Detail
-
computeFor
public double computeFor(ASTMethod node, net.sourceforge.pmd.lang.metrics.MetricOptions options)
-
booleanExpressionComplexity
public static int booleanExpressionComplexity(ASTStandardCondition expression)
Computes the number of control flow paths through that expression, which is the number of||and&&operators. Used both by Npath and Cyclo.- Parameters:
expression- Boolean expression- Returns:
- The complexity of the expression
-
-