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 Details

    • AbstractMethodMetric

      public AbstractMethodMetric()
  • 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
    • 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 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
    • lineNumberForMethod

      protected int lineNumberForMethod(org.codehaus.groovy.ast.MethodNode methodNode)