diff --git a/docs/config_metrics.html b/docs/config_metrics.html index 05db9aebc..6a457274f 100644 --- a/docs/config_metrics.html +++ b/docs/config_metrics.html @@ -24,9 +24,6 @@
@@ -98,78 +95,6 @@ considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now! TreeWalker - -- Restricts the number of executable statements to a specified limit. -
- - -| name | -description | -type | -default value | -
|---|---|---|---|
| max | -the maximum threshold allowed | -integer | -30 | -
| tokens | -members to check | - -subset of tokens CTOR_DEF, - METHOD_DEF, - INSTANCE_INIT, - STATIC_INIT - | - -all tokens | -
- 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> - -- -
- com.puppycrawl.tools.checkstyle.checks.metrics -
- -- TreeWalker -
- - diff --git a/docs/config_sizes.html b/docs/config_sizes.html index 0501cd5b3..fddfada67 100644 --- a/docs/config_sizes.html +++ b/docs/config_sizes.html @@ -22,6 +22,9 @@+ Restricts the number of executable statements to a specified limit. +
+ + +| name | +description | +type | +default value | +
|---|---|---|---|
| max | +the maximum threshold allowed | +integer | +30 | +
| tokens | +members to check | + +subset of tokens CTOR_DEF, + METHOD_DEF, + INSTANCE_INIT, + STATIC_INIT + | + +all tokens | +
+ 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> + ++ +
+ com.puppycrawl.tools.checkstyle.checks.sizes +
+ ++ TreeWalker +
+ +Checks for long source files. diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/metrics/messages.properties b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/metrics/messages.properties index 3cd0be986..dfac2be79 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/metrics/messages.properties +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/metrics/messages.properties @@ -3,7 +3,6 @@ classDataAbstractionCoupling=Class Data Abstraction Coupling is {0,number,intege classFanOutComplexity=Class Fan-Out Complexity is {0,number,integer} (max allowed is {1,number,integer}). cyclomaticComplexity=Cyclomatic Complexity is {0,number,integer} (max allowed is {1,number,integer}). duplicateLiteral=Duplicate instances of literal ''{0}'' are not allowed. -executableStatementCount=Executable statement count is {0,number,integer} (max allowed is {1,number,integer}). finalField=The field ''{0}'' should be declared final. illegalAbstractClassName=Name ''{0}'' must match pattern ''{1}''. illegalCatch=Catching ''{0}'' is not allowed. diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/metrics/ExecutableStatementCountCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheck.java similarity index 99% rename from src/checkstyle/com/puppycrawl/tools/checkstyle/checks/metrics/ExecutableStatementCountCheck.java rename to src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheck.java index 40831fdd6..6ed52c3aa 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/metrics/ExecutableStatementCountCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheck.java @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// -package com.puppycrawl.tools.checkstyle.checks.metrics; +package com.puppycrawl.tools.checkstyle.checks.sizes; import java.util.Stack; diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/messages.properties b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/messages.properties index 8a506949d..d3233af29 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/messages.properties +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/sizes/messages.properties @@ -1,3 +1,4 @@ +executableStatementCount=Executable statement count is {0,number,integer} (max allowed is {1,number,integer}). maxLen.file=File length is {0,number,integer} lines (max allowed is {1,number,integer}). maxLen.method=Method length is {0,number,integer} lines (max allowed is {1,number,integer}). maxLen.anonInner=Anonymous inner class length is {0,number,integer} lines (max allowed is {1,number,integer}). diff --git a/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java b/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java index 85c128b4d..474f8d259 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java @@ -73,7 +73,6 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheckTest; import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheckTest; import com.puppycrawl.tools.checkstyle.checks.javadoc.PackageHtmlCheckTest; import com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheckTest; -import com.puppycrawl.tools.checkstyle.checks.metrics.ExecutableStatementCountCheckTest; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheckTest; import com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheckTest; import com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheckTest; @@ -85,6 +84,7 @@ import com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheckTest; import com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheckTest; import com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheckTest; import com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheckTest; +import com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheckTest; import com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheckTest; import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheckTest; import com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheckTest; diff --git a/src/tests/com/puppycrawl/tools/checkstyle/checks/metrics/ExecutableStatementCountCheckTest.java b/src/tests/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java similarity index 98% rename from src/tests/com/puppycrawl/tools/checkstyle/checks/metrics/ExecutableStatementCountCheckTest.java rename to src/tests/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java index edca8d03b..7ac0ee5e8 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/checks/metrics/ExecutableStatementCountCheckTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java @@ -1,4 +1,4 @@ -package com.puppycrawl.tools.checkstyle.checks.metrics; +package com.puppycrawl.tools.checkstyle.checks.sizes; import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; import com.puppycrawl.tools.checkstyle.DefaultConfiguration;