Class NestedForDepthCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public final class NestedForDepthCheck
    extends AbstractCheck
    Check the number of nested for -statements. The maximum number of nested layers can be configured. The default value is 1. The code for the class is copied from the NestedIfDepthCheck-class. The only difference is the intercepted token (for instead of if). Example:
      <!-- Restricts nested for blocks to a specified depth (default = 1).
                                                                            -->
      <module name="com.puppycrawl.tools.checkstyle.checks.coding
                                                .CatchWithLostStackCheck">
        <property name="severity" value="info"/>
        <property name="max" value="1"/>
      </module>
     
    Author:
    Alexander Jesse
    See Also:
    NestedIfDepthCheck