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
  • Field Details

    • SCALE

      protected static final int SCALE
      See Also:
    • ROUNDING_MODE

      protected static final int ROUNDING_MODE
    • LOG

      protected static final Object LOG
  • Constructor Details

    • AbstractCoberturaCoverageMetric

      public AbstractCoberturaCoverageMetric()
  • Method Details

    • getMetaClass

      public groovy.lang.MetaClass getMetaClass()
      Specified by:
      getMetaClass in interface groovy.lang.GroovyObject
      Overrides:
      getMetaClass in class AbstractMetric
    • setMetaClass

      public void setMetaClass(groovy.lang.MetaClass mc)
      Specified by:
      setMetaClass in interface groovy.lang.GroovyObject
      Overrides:
      setMetaClass in class AbstractMetric
    • invokeMethod

      public Object invokeMethod(String method, Object arguments)
      Specified by:
      invokeMethod in interface groovy.lang.GroovyObject
      Overrides:
      invokeMethod in class AbstractMetric
    • getProperty

      public Object getProperty(String property)
      Specified by:
      getProperty in interface groovy.lang.GroovyObject
      Overrides:
      getProperty in class AbstractMetric
    • setProperty

      public void setProperty(String property, Object value)
      Specified by:
      setProperty in interface groovy.lang.GroovyObject
      Overrides:
      setProperty in class AbstractMetric
    • getBaseLevel

      public final MetricLevel getBaseLevel()
      Specified by:
      getBaseLevel in interface Metric
    • 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 interface MethodMetric
    • applyToClosure

      public MetricResult applyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
      Specified by:
      applyToClosure in interface MethodMetric
    • calculateForClass

      protected ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
      Specified by:
      calculateForClass in class AbstractMetric
    • calculateForPackage

      protected MetricResult calculateForPackage(String packagePath, String packageName, Collection<MetricResult> childMetricResults)
      Overrides:
      calculateForPackage in class AbstractMetric
    • calculate

      public MetricResult calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
    • getCoverageRatioForClass

      protected Ratio getCoverageRatioForClass(String className)
    • 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)