Groovy Documentation

org.codenarc.rule.size
[Groovy] Class MethodSizeRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      org.codenarc.rule.AbstractAstVisitorRule
          org.codenarc.rule.size.MethodSizeRule

class MethodSizeRule
extends AbstractAstVisitorRule

Rule that checks the size of a method.

The maxLines property holds the threshold value for the maximum number of lines. A method length (number of lines) greater than that value is considered a violation. The maxLines property defaults to 100.

The ignoreMethodNames property optionally specifies one or more (comma-separated) method names that should be ignored (i.e., that should not cause a rule violation). The name(s) may optionally include wildcard characters ('*' or '?').

Authors:
Chris Mair
Hamlet D'Arcy
Version:
\$Revision: 439 \$ - \$Date: 2010-11-08 15:16:30 -0500 (Mon, 08 Nov 2010) \$


Field Summary
 
Fields inherited from class AbstractAstVisitorRule
DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME
 
Property Summary
Class astVisitorClass

String ignoreMethodNames

int maxLines

String name

int priority

 
Method Summary
 
Methods inherited from class AbstractAstVisitorRule
applyTo, getAstVisitor, shouldApplyThisRuleTo
 
Methods inherited from class AbstractRule
applyTo, applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, isReady, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport, toString, validate
 

Property Detail

astVisitorClass

Class astVisitorClass


ignoreMethodNames

String ignoreMethodNames


maxLines

int maxLines


name

String name


priority

int priority


 

Groovy Documentation