Package org.gmetrics.metric.crap
Class CrapMetric
- java.lang.Object
-
- org.gmetrics.metric.AbstractMetric
-
- org.gmetrics.metric.AbstractMethodMetric
-
- org.gmetrics.metric.crap.CrapMetric
-
- All Implemented Interfaces:
groovy.lang.GroovyObject
,MethodMetric
,Metric
public class CrapMetric extends AbstractMethodMetric
-
-
Constructor Summary
Constructors Constructor Description CrapMetric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricResult
calculate(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
MetricResult
calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
protected java.math.BigDecimal
calculateCrapScore(java.math.BigDecimal complexity, java.math.BigDecimal coverage)
MethodMetric
getComplexityMetric()
MethodMetric
getCoverageMetric()
groovy.lang.MetaClass
getMetaClass()
java.lang.String
getName()
java.lang.Object
getProperty(java.lang.String property)
java.lang.Object
invokeMethod(java.lang.String method, java.lang.Object arguments)
void
setComplexityMetric(MethodMetric value)
void
setCoverageMetric(MethodMetric value)
void
setMetaClass(groovy.lang.MetaClass mc)
void
setProperty(java.lang.String property, java.lang.Object value)
-
Methods inherited from class org.gmetrics.metric.AbstractMethodMetric
applyToClosure, applyToMethod, calculateForClass, getBaseLevel, getIncludeClosureFields, isIncludeClosureFields, lineNumberForMethod, setIncludeClosureFields
-
Methods inherited from class org.gmetrics.metric.AbstractMetric
applyToClass, applyToPackage, calculateForPackage, createAggregateMetricResult, createAggregateMetricResult, getEnabled, getFunctions, isEnabled, isNotAnInterface, setEnabled, setFunctions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gmetrics.metric.Metric
applyToClass, applyToPackage, getFunctions, isEnabled
-
-
-
-
Method Detail
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClass
in interfacegroovy.lang.GroovyObject
- Overrides:
getMetaClass
in classAbstractMethodMetric
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
- Overrides:
setMetaClass
in classAbstractMethodMetric
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
- Overrides:
invokeMethod
in classAbstractMethodMetric
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
getProperty
in classAbstractMethodMetric
-
setProperty
public void setProperty(java.lang.String property, java.lang.Object value)
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
setProperty
in classAbstractMethodMetric
-
getName
public final java.lang.String getName()
-
getCoverageMetric
public MethodMetric getCoverageMetric()
-
setCoverageMetric
public void setCoverageMetric(MethodMetric value)
-
getComplexityMetric
public MethodMetric getComplexityMetric()
-
setComplexityMetric
public void setComplexityMetric(MethodMetric value)
-
calculate
public MetricResult calculate(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
- Specified by:
calculate
in classAbstractMethodMetric
-
calculate
public MetricResult calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
- Specified by:
calculate
in classAbstractMethodMetric
-
calculateCrapScore
protected java.math.BigDecimal calculateCrapScore(java.math.BigDecimal complexity, java.math.BigDecimal coverage)
-
-