Class NestedForDepthCheck

All Implemented Interfaces:
Configurable, Contextualizable

public final class NestedForDepthCheck extends AbstractCheck
Restricts nested for blocks to a specified depth.
  • Property max - Specify maximum allowed nesting depth. Type is int. Default value is 1.

Parent is com.puppycrawl.tools.checkstyle.TreeWalker

Violation Message Keys:

  • nested.for.depth
Since:
5.3
  • Field Details

    • MSG_KEY

      public static final String MSG_KEY
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • max

      private int max
      Specify maximum allowed nesting depth.
    • depth

      private int depth
      Current nesting depth.
  • Constructor Details

  • Method Details