Moved ExecutableStatementCountCheck to sizes package.
This commit is contained in:
parent
258c092278
commit
20b7faa450
|
|
@ -24,9 +24,6 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="#CyclomaticComplexity">CyclomaticComplexity</a>
|
||||
<li>
|
||||
<a href="#ExecutableStatementCount">ExecutableStatementCount</a>
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
|
@ -98,78 +95,6 @@ considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now!
|
|||
<a href="config.html#treewalker">TreeWalker</a>
|
||||
</p>
|
||||
|
||||
|
||||
<!-- --><a name="ExecutableStatementCount"></a> <h2>ExecutableStatementCount</h2>
|
||||
<h4>Description</h4>
|
||||
|
||||
<p class="body">
|
||||
Restricts the number of executable statements to a specified limit.
|
||||
</p>
|
||||
|
||||
|
||||
<h4>Properties</h4>
|
||||
<table width="100%" border="1" cellpadding="5" class="body">
|
||||
<tr class="header">
|
||||
<th>name</th>
|
||||
<th>description</th>
|
||||
<th>type</th>
|
||||
<th>default value</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>max</td>
|
||||
<td>the maximum threshold allowed</td>
|
||||
<td><a href="property_types.html#integer">integer</a></td>
|
||||
<td><span class="default">30</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>tokens</td>
|
||||
<td>members to check</td>
|
||||
|
||||
<td>subset of tokens <a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INSTANCE_INIT">INSTANCE_INIT</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#STATIC_INIT">STATIC_INIT</a>
|
||||
</td>
|
||||
|
||||
<td>all tokens</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<p class="body">
|
||||
To configure the check:
|
||||
</p>
|
||||
<pre class="body">
|
||||
<module name="ExecutableStatementCount"/>
|
||||
</pre>
|
||||
<p class="body">
|
||||
To configure the check with a threshold of 20 for constructor and
|
||||
method definitions:
|
||||
</p>
|
||||
<pre class="body">
|
||||
<module name="ExecutableStatementCount">
|
||||
<property name="max" value="20"/>
|
||||
<property name="tokens" value="CTOR_DEF,METHOD_DEF"/>
|
||||
</module>
|
||||
|
||||
</pre>
|
||||
|
||||
<h4>Package</h4>
|
||||
<p class="body">
|
||||
com.puppycrawl.tools.checkstyle.checks.metrics
|
||||
</p>
|
||||
|
||||
<h4>Parent Module</h4>
|
||||
<p class="body">
|
||||
<a href="config.html#treewalker">TreeWalker</a>
|
||||
</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@
|
|||
<!--Left menu-->
|
||||
<td class="menu" valign="top">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#ExecutableStatementCount">ExecutableStatementCount</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#FileLength">FileLength</a>
|
||||
</li>
|
||||
|
|
@ -42,6 +45,79 @@
|
|||
<!--Content-->
|
||||
<td class="content" valign="top" align="left">
|
||||
|
||||
|
||||
|
||||
<!-- --><a name="ExecutableStatementCount"></a> <h2>ExecutableStatementCount</h2>
|
||||
<h4>Description</h4>
|
||||
|
||||
<p class="body">
|
||||
Restricts the number of executable statements to a specified limit.
|
||||
</p>
|
||||
|
||||
|
||||
<h4>Properties</h4>
|
||||
<table width="100%" border="1" cellpadding="5" class="body">
|
||||
<tr class="header">
|
||||
<th>name</th>
|
||||
<th>description</th>
|
||||
<th>type</th>
|
||||
<th>default value</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>max</td>
|
||||
<td>the maximum threshold allowed</td>
|
||||
<td><a href="property_types.html#integer">integer</a></td>
|
||||
<td><span class="default">30</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>tokens</td>
|
||||
<td>members to check</td>
|
||||
|
||||
<td>subset of tokens <a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INSTANCE_INIT">INSTANCE_INIT</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#STATIC_INIT">STATIC_INIT</a>
|
||||
</td>
|
||||
|
||||
<td>all tokens</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<p class="body">
|
||||
To configure the check:
|
||||
</p>
|
||||
<pre class="body">
|
||||
<module name="ExecutableStatementCount"/>
|
||||
</pre>
|
||||
<p class="body">
|
||||
To configure the check with a threshold of 20 for constructor and
|
||||
method definitions:
|
||||
</p>
|
||||
<pre class="body">
|
||||
<module name="ExecutableStatementCount">
|
||||
<property name="max" value="20"/>
|
||||
<property name="tokens" value="CTOR_DEF,METHOD_DEF"/>
|
||||
</module>
|
||||
|
||||
</pre>
|
||||
|
||||
<h4>Package</h4>
|
||||
<p class="body">
|
||||
com.puppycrawl.tools.checkstyle.checks.sizes
|
||||
</p>
|
||||
|
||||
<h4>Parent Module</h4>
|
||||
<p class="body">
|
||||
<a href="config.html#treewalker">TreeWalker</a>
|
||||
</p>
|
||||
|
||||
|
||||
<a name="FileLength"></a> <h2>FileLength</h2> <h4>Description</h4>
|
||||
<p class="body">
|
||||
Checks for long source files.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
@ -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}).
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
Loading…
Reference in New Issue