Since Checkstyle 3.2
name | description | type | default value | since |
---|---|---|---|---|
max | Specify the maximum threshold allowed. | int | 30 |
3.2 |
tokens | tokens to check | subset of tokens CTOR_DEF , METHOD_DEF , INSTANCE_INIT , STATIC_INIT , COMPACT_CTOR_DEF , LAMBDA . | CTOR_DEF , METHOD_DEF , INSTANCE_INIT , STATIC_INIT , COMPACT_CTOR_DEF , LAMBDA . | 3.2 |
To configure the check:
<module name="Checker"> <module name="TreeWalker"> <module name="ExecutableStatementCount"/> </module> </module>
To configure the check with a threshold of 20 for constructor and method definitions:
<module name="Checker"> <module name="TreeWalker"> <module name="ExecutableStatementCount"> <property name="max" value="20"/> <property name="tokens" value="CTOR_DEF,METHOD_DEF"/> </module> </module> </module>
All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.
com.puppycrawl.tools.checkstyle.checks.sizes