Package: org.gmetrics.metric.coverage

## [Groovy] Class AbstractCoberturaCoverageMetric

- org.gmetrics.metric.coverage.AbstractCoberturaCoverageMetric

- All Implemented Interfaces and Traits:
    MethodMetric

      abstract class AbstractCoberturaCoverageMetric
      extends AbstractMetric

  Abstract superclass for metrics that provide test code coverage from a Cobertura XML file.

  Authors:
    Chris Mair

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected static def` | `LOG` |
    `protected static int` | `ROUNDING_MODE` |
    `protected static int` | `SCALE` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `MetricLevel` | `baseLevel`
    `String` | `coberturaFile`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and 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 String`

    `getAttributeName()`
    Returns:
      the name of the desired coverage attribute within the Cobertura XML file (e.g.

    `` | `protected Ratio` | `getCoverageRatioForClass(String className)`
    `` | `protected Ratio` | `getCoverageRatioForSingleClass(def matchingClassElement)` @return the calculated coverage ratio for the Cobertura XML class element

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractMetric` | `applyToClass, applyToPackage, calculateForClass, calculateForPackage, createAggregateMetricResult, isNotAnInterface`

- - ### Field Detail

    - #### @SuppressWarnings('LoggerWithWrongModifiers') protected static final def LOG

    - #### protected static final int ROUNDING_MODE

    - #### protected static final int SCALE

  - ### Property Detail

    - #### final MetricLevel baseLevel

    - #### String coberturaFile

  - ### Method Detail

    - #### @Override MetricResult applyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)

    - #### @Override MetricResult applyToMethod(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)

    - #### MetricResult calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)

    - #### @Override protected ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)

    - #### @Override 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 String getAttributeName()

      Returns:
        the name of the desired coverage attribute within the Cobertura XML file (e.g. "line-rate")

    - #### protected Ratio getCoverageRatioForClass(String className)

    - #### protected Ratio getCoverageRatioForSingleClass(def matchingClassElement)

      Returns:
        the calculated coverage ratio for the Cobertura XML class element