Package org.gmetrics.metric.coverage
Class AbstractCoberturaCoverageMetric
- java.lang.Object
-
- org.gmetrics.metric.AbstractMetric
-
- org.gmetrics.metric.coverage.AbstractCoberturaCoverageMetric
-
- All Implemented Interfaces:
groovy.lang.GroovyObject
,MethodMetric
,Metric
- Direct Known Subclasses:
CoberturaBranchCoverageMetric
,CoberturaLineCoverageMetric
public abstract class AbstractCoberturaCoverageMetric extends AbstractMetric implements MethodMetric, groovy.lang.GroovyObject
-
-
Field Summary
Fields Modifier and Type Field Description protected static Object
LOG
protected static int
ROUNDING_MODE
protected static int
SCALE
-
Constructor Summary
Constructors Constructor Description AbstractCoberturaCoverageMetric()
-
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)
MetricResult
calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
protected ClassMetricResult
calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
protected MetricResult
calculateForPackage(String packagePath, String packageName, Collection<MetricResult> childMetricResults)
protected SingleNumberMetricResult
calculateMethodResult(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)
protected groovy.util.slurpersupport.GPathResult
findMethodElement(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)
protected abstract String
getAttributeName()
MetricLevel
getBaseLevel()
String
getCoberturaFile()
protected Ratio
getCoverageRatioForClass(String className)
protected abstract Ratio
getCoverageRatioForSingleClass(Object matchingClassElement)
groovy.lang.MetaClass
getMetaClass()
Object
getProperty(String property)
Object
invokeMethod(String method, Object arguments)
void
setCoberturaFile(String value)
void
setMetaClass(groovy.lang.MetaClass mc)
void
setProperty(String property, Object value)
-
Methods inherited from class org.gmetrics.metric.AbstractMetric
applyToClass, applyToPackage, 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
-
-
-
-
Field Detail
-
SCALE
protected static final int SCALE
- See Also:
- Constant Field Values
-
ROUNDING_MODE
protected static final int ROUNDING_MODE
-
LOG
protected static final Object LOG
-
-
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 Object invokeMethod(String method, Object arguments)
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
- Overrides:
invokeMethod
in classAbstractMetric
-
getProperty
public Object getProperty(String property)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
getProperty
in classAbstractMetric
-
setProperty
public void setProperty(String property, Object value)
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
setProperty
in classAbstractMetric
-
getBaseLevel
public final MetricLevel getBaseLevel()
- Specified by:
getBaseLevel
in interfaceMetric
-
getCoberturaFile
public String getCoberturaFile()
-
setCoberturaFile
public void setCoberturaFile(String value)
-
getAttributeName
protected abstract String getAttributeName()
-
getCoverageRatioForSingleClass
protected abstract Ratio getCoverageRatioForSingleClass(Object matchingClassElement)
-
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
-
calculateForPackage
protected MetricResult calculateForPackage(String packagePath, String packageName, Collection<MetricResult> childMetricResults)
- Overrides:
calculateForPackage
in classAbstractMetric
-
calculate
public MetricResult calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
-
calculateMethodResult
protected SingleNumberMetricResult calculateMethodResult(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)
-
findMethodElement
protected groovy.util.slurpersupport.GPathResult findMethodElement(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)
-
-