Groovy Documentation

org.codenarc.rule.size
Class NestedBlockDepthRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      org.codenarc.rule.AbstractAstVisitorRule
          org.codenarc.rule.size.NestedBlockDepthRule

class NestedBlockDepthRule
extends AbstractAstVisitorRule

Rule that checks for blocks or closures nested more than a configured maximum number. Blocks include if, for, while, switch, try, catch, finally and synchronized blocks/statements, as well as closures.

The maxNestedBlockDepth property holds the threshold value for the maximum number of nesting levels. A block or closures nested deeper than that numer of levels is considered a violation. The maxNestedBlockDepth property defaults to 3.

author:
Chris Mair
version:
$Revision: 321 $ - $Date: 2010-04-15 21:38:05 -0400 (Thu, 15 Apr 2010) $


Property Summary
Class astVisitorClass

int maxNestedBlockDepth

String name

int priority

 
Constructor Summary
NestedBlockDepthRule()

 
Method Summary
 
Methods inherited from class AbstractAstVisitorRule
shouldApplyThisRuleTo
 
Methods inherited from class AbstractRule
applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport
 

Property Detail

astVisitorClass

Class astVisitorClass


maxNestedBlockDepth

int maxNestedBlockDepth


name

String name


priority

int priority


 
Constructor Detail

NestedBlockDepthRule

NestedBlockDepthRule()


 

Groovy Documentation