class DuplicateNumberLiteralRule extends AbstractAstVisitorRule
Checks for duplication of constant number literal values.
Set the optionalignoreNumbers 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.
Set the optional duplicateNumberMinimumValue property to an integer so this rule
will ignore literal numbers lower than this parameter (i.e., not cause a violation). There is
no default value for this property
By default, this rule does not apply to test files. | Fields inherited from class | Fields |
|---|---|
class AbstractAstVisitorRule |
CLOSURE_TEXT, DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME |
| Type | Name and description |
|---|---|
java.lang.String |
doNotApplyToFilesMatching |
java.lang.Integer |
duplicateNumberMinimumValue |
java.lang.String |
ignoreNumbers |
java.lang.String |
name |
int |
priority |
| Constructor and description |
|---|
DuplicateNumberLiteralRule
() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
AstVisitor |
getAstVisitor() |
Groovy Documentation