Package org.gmetrics.metric
Class AbstractMethodMetric
- java.lang.Object
-
- org.gmetrics.metric.AbstractMetric
-
- org.gmetrics.metric.AbstractMethodMetric
-
- All Implemented Interfaces:
groovy.lang.GroovyObject
,MethodMetric
,Metric
- Direct Known Subclasses:
AbcMetric
,CrapMetric
,CyclomaticComplexityMetric
,MethodLineCountMetric
public abstract class AbstractMethodMetric extends AbstractMetric implements MethodMetric, groovy.lang.GroovyObject
-
-
Constructor Summary
Constructors Constructor Description AbstractMethodMetric()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MetricResult
applyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
MetricResult
applyToMethod(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
abstract MetricResult
calculate(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
abstract MetricResult
calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
protected ClassMetricResult
calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
MetricLevel
getBaseLevel()
boolean
getIncludeClosureFields()
groovy.lang.MetaClass
getMetaClass()
java.lang.Object
getProperty(java.lang.String property)
java.lang.Object
invokeMethod(java.lang.String method, java.lang.Object arguments)
boolean
isIncludeClosureFields()
protected int
lineNumberForMethod(org.codehaus.groovy.ast.MethodNode methodNode)
void
setIncludeClosureFields(boolean value)
void
setMetaClass(groovy.lang.MetaClass mc)
void
setProperty(java.lang.String property, java.lang.Object value)
-
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, getName, isEnabled
-
-
-
-
Method Detail
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClass
in interfacegroovy.lang.GroovyObject
- Overrides:
getMetaClass
in classAbstractMetric
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
- Overrides:
setMetaClass
in classAbstractMetric
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
- Overrides:
invokeMethod
in classAbstractMetric
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
getProperty
in classAbstractMetric
-
setProperty
public void setProperty(java.lang.String property, java.lang.Object value)
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
setProperty
in classAbstractMetric
-
getBaseLevel
public final MetricLevel getBaseLevel()
- Specified by:
getBaseLevel
in interfaceMetric
-
getIncludeClosureFields
public boolean getIncludeClosureFields()
-
isIncludeClosureFields
public boolean isIncludeClosureFields()
-
setIncludeClosureFields
public void setIncludeClosureFields(boolean value)
-
calculate
public abstract MetricResult calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
-
calculate
public abstract MetricResult calculate(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
-
applyToMethod
public MetricResult applyToMethod(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
- Specified by:
applyToMethod
in interfaceMethodMetric
-
applyToClosure
public MetricResult applyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
- Specified by:
applyToClosure
in interfaceMethodMetric
-
calculateForClass
protected ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
- Specified by:
calculateForClass
in classAbstractMetric
-
lineNumberForMethod
protected int lineNumberForMethod(org.codehaus.groovy.ast.MethodNode methodNode)
-
-