All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.puppycrawl.tools.checkstyle.meta.checks.metrics.JavaNCSSCheck.xml Maven / Gradle / Ivy

Go to download

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard

There is a newer version: 10.20.1
Show newest version
<?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>&lt;p&gt;
 Determines complexity of methods, classes and files by counting
 the Non Commenting Source Statements (NCSS). This check adheres to the
 &lt;a href="http://www.kclee.de/clemens/java/javancss/#specification"&gt;specification&lt;/a&gt;
 for the &lt;a href="http://www.kclee.de/clemens/java/javancss/"&gt;JavaNCSS-Tool&lt;/a&gt;
 written by &lt;b&gt;Chr. Clemens Lee&lt;/b&gt;.
 &lt;/p&gt;
 &lt;p&gt;
 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.
 &lt;/p&gt;
 &lt;p&gt;
 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.
 &lt;/p&gt;
 &lt;p&gt;
 The NCSS for a file is summarized from the ncss of all its top level classes,
 the number of imports and the package declaration.
 &lt;/p&gt;
 &lt;p&gt;
 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.
 &lt;/p&gt;</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>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy