org.codenarc.rule.basic
[Groovy] Class ConstantIfExpressionRule
java.lang.Object
org.codenarc.rule.AbstractRule
org.codenarc.rule.AbstractAstVisitorRule
org.codenarc.rule.basic.ConstantIfExpressionRule
class ConstantIfExpressionRule
extends AbstractAstVisitorRule
Rule that checks for if statement with a constant value for the if expression, such as:
if (true) { .. }
if (false) { .. }
if (Boolean.TRUE) { .. }
if (Boolean.FALSE) { .. }
if (null) { .. }
if (0) { .. }
if (99.7) { .. }
if ("") { .. }
if ("abc") { .. }
if ([a:123, b:456]) { .. }
if ([a, b]) { .. }
- Authors:
- Chris Mair
- Version:
- \$Revision: 553 \$ - \$Date: 2011-01-20 16:07:46 -0500 (Thu, 20 Jan 2011) \$
Methods inherited from class AbstractRule
|
applyTo, applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, isReady, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport, toString, validate |
astVisitorClass
Class astVisitorClass
-
name
String name
-
priority
int priority
-
Groovy Documentation