diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java index 24a93d5d7..76adfb142 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java @@ -92,7 +92,7 @@ public final class MethodCountCheck extends Check }; /** default maximum number of methods */ - private static final int DEFAULT_MAX_METHODS = 999; + private static final int DEFAULT_MAX_METHODS = 100; /** Maximum private methods. */ private int mMaxPrivate = DEFAULT_MAX_METHODS; /** Maximum package methods. */ diff --git a/src/xdocs/availablechecks.xml b/src/xdocs/availablechecks.xml index c1e8777c3..851a3187f 100644 --- a/src/xdocs/availablechecks.xml +++ b/src/xdocs/availablechecks.xml @@ -353,6 +353,10 @@ Checks that instance variable names conform to a format specified by the format property. +
+ Checks the number of methods declared in each type. This
+ includes the number of each scope (private,
+ package, protected and
+ public) as well as an overall total.
+
| name | +description | +type | +default value | +
|---|---|---|---|
| maxTotal | +maximum allowable number of methods at all scope levels | +integer | +100 | +
| maxPrivate | +maximum allowable number of private methods |
+ integer | +100 | +
| maxPackage | +maximum allowable number of package methods |
+ integer | +100 | +
| maxProtected | +maximum allowable number of protected methods |
+ integer | +100 | +
| maxPublic | +maximum allowable number of public methods |
+ integer | +100 | +
+ To configure the check with defaults: +
++ To configure the check to allow at most 30 methods per type: +
++ com.puppycrawl.tools.checkstyle.checks.sizes +
++ TreeWalker +
+