Class AbstractMethodMetricAstVisitor

java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.codenarc.rule.AbstractAstVisitor
org.codenarc.rule.size.AbstractMethodMetricAstVisitor
All Implemented Interfaces:
groovy.lang.GroovyObject, org.codehaus.groovy.ast.GroovyClassVisitor, org.codehaus.groovy.ast.GroovyCodeVisitor, AstVisitor
Direct Known Subclasses:
AbcMetricAstVisitor, CrapMetricAstVisitor, CyclomaticComplexityAstVisitor

public abstract class AbstractMethodMetricAstVisitor extends AbstractAstVisitor implements groovy.lang.GroovyObject
  • Field Details

    • metric

      protected org.gmetrics.metric.Metric metric
  • Constructor Details

    • AbstractMethodMetricAstVisitor

      public AbstractMethodMetricAstVisitor()
  • Method Details

    • getMetaClass

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

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

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

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

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

      protected abstract org.gmetrics.metric.Metric createMetric()
    • getMetricShortDescription

      protected abstract String getMetricShortDescription()
    • getMaxMethodMetricValue

      protected abstract Object getMaxMethodMetricValue()
    • getMaxClassMetricValue

      protected abstract Object getMaxClassMetricValue()
    • getMaxClassAverageMethodMetricValue

      protected abstract Object getMaxClassAverageMethodMetricValue()
    • visitClassEx

      public void visitClassEx(org.codehaus.groovy.ast.ClassNode classNode)
      Overrides:
      visitClassEx in class AbstractAstVisitor
    • extractMethodName

      protected String extractMethodName(Object method)
    • addViolation

      protected void addViolation(org.gmetrics.result.MetricResult classResults, String message)
    • getLineNumber

      protected Integer getLineNumber(org.gmetrics.result.MetricResult methodResults)
    • getSourceLine

      protected String getSourceLine(Integer lineNumber)
    • isIgnoredMethodName

      protected boolean isIgnoredMethodName(String methodName)