com.puppycrawl.tools.checkstyle.meta.checks.metrics.JavaNCSSCheck.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checkstyle Show documentation
Show all versions of checkstyle Show documentation
Checkstyle is a development tool to help programmers write Java code
that adheres to a coding standard
<?xml version="1.0" encoding="UTF-8"?> <checkstyle-metadata> <module> <check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck" name="JavaNCSS" parent="com.puppycrawl.tools.checkstyle.TreeWalker"> <description><p> Determines complexity of methods, classes and files by counting the Non Commenting Source Statements (NCSS). This check adheres to the <a href="http://www.kclee.de/clemens/java/javancss/#specification">specification</a> for the <a href="http://www.kclee.de/clemens/java/javancss/">JavaNCSS-Tool</a> written by <b>Chr. Clemens Lee</b>. </p> <p> Roughly said the NCSS metric is calculated by counting the source lines which are not comments, (nearly) equivalent to counting the semicolons and opening curly braces. </p> <p> The NCSS for a class is summarized from the NCSS of all its methods, the NCSS of its nested classes and the number of member variable declarations. </p> <p> The NCSS for a file is summarized from the ncss of all its top level classes, the number of imports and the package declaration. </p> <p> Rationale: Too large methods and classes are hard to read and costly to maintain. A large NCSS number often means that a method or class has too many responsibilities and/or functionalities which should be decomposed into smaller units. </p></description> <properties> <property default-value="1500" name="classMaximum" type="int"> <description>Specify the maximum allowed number of non commenting lines in a class.</description> </property> <property default-value="2000" name="fileMaximum" type="int"> <description>Specify the maximum allowed number of non commenting lines in a file including all top level and nested classes.</description> </property> <property default-value="50" name="methodMaximum" type="int"> <description>Specify the maximum allowed number of non commenting lines in a method.</description> </property> <property default-value="150" name="recordMaximum" type="int"> <description>Specify the maximum allowed number of non commenting lines in a record.</description> </property> </properties> <message-keys> <message-key key="ncss.class"/> <message-key key="ncss.file"/> <message-key key="ncss.method"/> <message-key key="ncss.record"/> </message-keys> </check> </module> </checkstyle-metadata>