Class ExecutableStatementCountCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public final class ExecutableStatementCountCheck
    extends AbstractCheck

    Restricts the number of executable statements to a specified limit.

    To configure the check:

     <module name="ExecutableStatementCount"/>
     

    To configure the check with a threshold of 20 for constructor and method definitions:

     <module name="ExecutableStatementCount">
       <property name="max" value="20"/>
       <property name="tokens" value="CTOR_DEF,METHOD_DEF"/>
     </module>
     

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • executableStatementCount
    Since:
    3.2