Groovy Documentation

org.codenarc.rule.dry
[Groovy] Class DuplicateNumberLiteralRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      org.codenarc.rule.AbstractAstVisitorRule
          org.codenarc.rule.dry.DuplicateNumberLiteralRule

class DuplicateNumberLiteralRule
extends AbstractAstVisitorRule

Checks for duplication of constant number literal values.

Set the optional ignoreNumbers property to a comma-separated list (String) of the numbers that should be ignored by this rule (i.e., not cause a violation). This property defaults to "0,1" to ignore the constants zero and one.

Authors:
Chris Mair
Version:
\$Revision: 465 \$ - \$Date: 2010-11-12 20:12:55 -0500 (Fri, 12 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
String doNotApplyToFilesMatching

String ignoreNumbers

String name

int priority

 
Method Summary
AstVisitor getAstVisitor()

 
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

doNotApplyToFilesMatching

String doNotApplyToFilesMatching


ignoreNumbers

String ignoreNumbers


name

String name


priority

int priority


 
Method Detail

getAstVisitor

@Override
AstVisitor getAstVisitor()


 

Groovy Documentation