|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD | |||||||
java.lang.Objectorg.codenarc.rule.AbstractAstVisitorRule
groovy.org.codenarc.rule.convention.IfStatementCouldBeTernaryRule
class IfStatementCouldBeTernaryRule extends AbstractAstVisitorRule
Checks for: (1) An if statements where both the if and else blocks contain only a single return statement with a constant or literal value. (2) When the second-to-last statement in a block is an if statement with no else, where the block contains a single return statement, and the last statement in the block is a return statement, and both return statements return a constant or literal value. This checks can be disabled by setting checkLastStatementImplicitElse to false.
| Property Summary | |
|---|---|
Class |
astVisitorClass
|
boolean |
checkLastStatementImplicitElse
|
String |
name
|
int |
priority
|
| Property Detail |
|---|
Class astVisitorClass
boolean checkLastStatementImplicitElse
String name
int priority
Groovy Documentation