Groovy Documentation

groovy.org.codenarc.rule.convention
[Groovy] Class InvertedIfElseRule

java.lang.Object
  org.codenarc.rule.AbstractAstVisitorRule
      groovy.org.codenarc.rule.convention.InvertedIfElseRule

class InvertedIfElseRule
extends AbstractAstVisitorRule

An inverted if-else statement is one in which there is a single if statement with a single else branch and the boolean test of the if is negated. For instance "if (!x) false else true". It is usually clearer to write this as "if (x) true else false".

Authors:
Hamlet D'Arcy


Property Summary
Class astVisitorClass

String name

int priority

 

Property Detail

astVisitorClass

Class astVisitorClass


name

String name


priority

int priority


 

Groovy Documentation