Sfoglia il codice sorgente

assira.rules - standard/custom for PMD5

Ranides Atterwim 11 anni fa
parent
commit
a15ed88a8f

+ 17 - 3
assira.common/pom.xml

@@ -90,11 +90,15 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-pmd-plugin</artifactId>
-                <version>2.7.1</version>
+                <version>3.5</version>
                 <configuration>
                     <rulesets>
-                        <ruleset>http://ranides.net/projects/pmd/assira.custom.xml</ruleset>
-                        <ruleset>http://ranides.net/projects/pmd/assira.standard.xml</ruleset>
+                        <!--
+                        <ruleset>http://ranides.net/projects/pmd/3/assira.custom.xml</ruleset>
+                        <ruleset>http://ranides.net/projects/pmd/3/assira.standard.xml</ruleset>
+                        -->
+                        <ruleset>http://dev.ranides.vnet/java/assira.custom.xml</ruleset>
+                        <ruleset>http://dev.ranides.vnet/java/assira.standard.xml</ruleset>
                     </rulesets>
                 </configuration>
             </plugin>
@@ -130,6 +134,11 @@
                     <skip>false</skip>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jxr-plugin</artifactId>
+                <version>2.3</version>
+            </plugin>
         </plugins>
     </build>
     
@@ -140,6 +149,11 @@
                 <artifactId>maven-javadoc-plugin</artifactId>
                 <version>2.9</version>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jxr-plugin</artifactId>
+                <version>2.3</version>
+            </plugin>
         </plugins>
     </reporting>
 

+ 1 - 1
assira.rules.test/pom.xml

@@ -19,7 +19,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-pmd-plugin</artifactId>
-                <version>5.3.3</version>
+                <version>3.5</version>
                 <configuration>
                     <rulesets>
                         <ruleset>rulesets/java/ranides.test.xml</ruleset>

+ 1 - 1
assira.rules/pom.xml

@@ -4,7 +4,7 @@
     
     <groupId>net.ranides</groupId>
     <artifactId>assira.rules</artifactId>
-    <version>1.0-SNAPSHOT</version>
+    <version>1.1</version>
     <packaging>jar</packaging>
     
     <url>http://ranides.net/projects/assira</url>

+ 353 - 0
assira.rules/src/main/resources/rulesets/java/assira.custom.xml

@@ -0,0 +1,353 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<ruleset name="net.ranides.assira.custom"
+    xmlns="http://pmd.sf.net/ruleset/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+    xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+
+    <description>
+    Assira Quality Policy - custom rules
+    </description>
+
+    <rule
+        name="TooManyDifferentMethods"
+        since="4.3"
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        message="This class has too many different methods, consider refactoring it."
+        externalInfoUrl="http://pmd.sourceforge.net/rules/codesize.html#TooManyMethods"
+        language="java"
+        >
+        <description><![CDATA[Counts unique methods (all overloaded versions are considered as the same). Ignores UtilityClassess.]]></description>
+        <priority>3</priority>
+        <properties>
+            <property name="maxmethods" type="Integer" description="The method count reporting threshold " min="1" max="1000" value="15"/>
+            <property name="xpath"><value>
+            <![CDATA[
+            //ClassOrInterfaceDeclaration[
+            
+                count(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration[
+                    MethodDeclaration
+                    and not(Annotation/MarkerAnnotation/Name[@Image='Override'])
+                    and not(starts-with(MethodDeclaration/@MethodName,'get'))
+                    and not(starts-with(MethodDeclaration/@MethodName,'set'))
+                    and not(
+                        MethodDeclaration/@MethodName
+                        =
+                        preceding-sibling::ClassOrInterfaceBodyDeclaration/MethodDeclaration/@MethodName
+                        )
+                ]) > $maxmethods
+            
+                and not (
+                    @Final='true'
+                    and
+                    ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[@Private='true'][@ParameterCount='0']
+                    and
+                    count(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration)=1
+                )
+            ]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+    
+    
+    <rule
+        name="TooManyPublicMethods"
+        since="4.3"
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        message="This class has too many public methods, consider refactoring it."
+        externalInfoUrl="http://pmd.sourceforge.net/rules/codesize.html#TooManyMethods"
+        language="java"
+        >
+        <description><![CDATA[Counts public methods]]></description>
+        <priority>3</priority>
+        <properties>
+            <property name="maxmethods" type="Integer" description="The method count reporting threshold " min="1" max="1000" value="40"/>
+            <property name="xpath"><value>
+            <![CDATA[
+            //ClassOrInterfaceDeclaration[
+                count(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/MethodDeclaration[
+                    @Public='true'
+                    and not(starts-with(@MethodName,'get'))
+                    and not(starts-with(@MethodName,'set'))
+                    and not(../Annotation/MarkerAnnotation/Name[@Image='Override'])
+                ]) > $maxmethods
+            ]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+    
+
+    <rule
+        name="ShortVar" 
+        since="2.0" 
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        message="Avoid variables with short names like {0}"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#ShortVariable"
+        language="java"
+        >
+        <description>
+            <![CDATA[Detects when a field, local, or parameter has a very short name.Ignores primitive types, local Iterators and for-variables.]]>
+        </description>
+        <priority>3</priority>
+        <properties><property name="xpath" pluginname="true"><value>
+            <![CDATA[
+            //VariableDeclaratorId [
+               string-length(@Image) < 3
+               and not(@Image='_')
+               and not(@Image='id')
+               and not(ancestor::ForInit)
+               and not(../Type/PrimitiveType)
+               and not(../../Type/PrimitiveType)
+               and not(
+                  (../../Type/ReferenceType/ClassOrInterfaceType[@Image='Iterator'])
+                  or
+                  (../../../FormalParameter)
+               )
+               and not(/TypeDeclaration/ClassOrInterfaceDeclaration[ends-with(@Image,'Test')])
+               and not((ancestor::FormalParameter) and (ancestor::TryStatement))
+               and not((@Image='em') and (../../Type/@TypeImage='EntityManager'))
+               and not((@Image='em') and (../Type/@TypeImage='EntityManager'))
+            ]
+            ]]>
+        </value></property></properties>
+    </rule>
+    
+    <rule
+        name="LongVar"
+      	since="0.3"
+        message="Avoid excessively long variable names like {0}"
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        externalInfoUrl="http://pmd.sourceforge.net/rules/naming.html#LongVariable"
+        language="java"
+        >
+        <description>Detects when a field, formal or local variable is declared with a long name.</description>
+        <priority>3</priority>
+        <properties>
+            <property name="minimum" type="Integer" description="The variable length reporting threshold" min="1" max="1000" value="16"/>
+            <property name="xpath" pluginname="true"><value>
+            <![CDATA[
+                //VariableDeclaratorId[
+                    string-length(@Image) > $minimum
+                    and (@Static='false' or @Final='false')
+                ]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+
+
+    <rule name="VarNameRules" since="2.0" class="net.sourceforge.pmd.lang.rule.XPathRule"
+        message="Field name doesn't respect required pattern"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#VariableNamingRegexp"
+        language="java"
+    >
+        <description>Checks all field names against regular expression</description>
+        <priority>3</priority>
+        <properties><property name="xpath" pluginname="true"><value>
+            <![CDATA[
+            //FieldDeclaration[
+                not(matches(@VariableName,'^(m_|\$)?([a-z][a-zA-Z0-9]*)$'))
+                and( (@Static='false') or (@Final='false') )
+            ]
+            ]]>
+        </value></property></properties>
+    </rule>
+
+    <rule name="MethodNameRules" since="2.0" class="net.sourceforge.pmd.lang.rule.XPathRule"
+        message="Method name doesn't respect required pattern"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#VariableNamingRegexp"
+        language="java"
+    >
+        <description>Checks all methods names against regular expression</description>
+        <priority>3</priority>
+        <properties><property name="xpath" pluginname="true"><value>
+            <![CDATA[
+            //MethodDeclaration/MethodDeclarator[
+                not(matches(@Image,'^(m_|\$)?([a-z][a-zA-Z0-9]*)$'))
+            ]
+            ]]>
+        </value></property></properties>
+    </rule>
+
+    <rule
+        name="InvalidUtilityClass"
+    	since="3.0"
+        message="Utility class does not provide any static methods, fields or interfaces"
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#InvalidUtilityClass"
+        language="java"
+        >
+        <description>A class that has private constructors and does not have any static methods, fields or type declarations cannot be used.</description>
+        <priority>3</priority>
+        <properties><property name="xpath"><value>
+            <![CDATA[
+            //ClassOrInterfaceDeclaration[@Nested='false'][
+                (
+                    count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration)>0
+                    and 
+                    count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration) = count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[@Private='true']) 
+                )
+                and count(.//MethodDeclaration[@Static='true'])=0
+                and count(.//FieldDeclaration[@Private='false'][@Static='true'])=0
+                and count(.//ClassOrInterfaceDeclaration[@Interface='true'])=0
+                and count(.//AnnotationTypeDeclaration)=0
+                and count(.//ClassOrInterfaceDeclaration[@Static='true' and @Private='false'])=0
+            ]
+            ]]>
+        </value></property></properties>
+    </rule>
+    
+    <rule
+        name="TooManyParams"
+    	since="3.0"
+        message="Avoid really long parameter lists."
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#TooManyParams"
+        language="java"
+        >
+        <description>Long parameter lists can indicate that a new object should be created to wrap the numerous parameters.  Basically, try to group the parameters together.</description>
+        <priority>3</priority>
+        <properties>
+            <property name="maximum" type="Integer" description="The parameter count reporting threshold" min="1" max="1000" value="6"/>
+            <property name="xpath"><value>
+            <![CDATA[
+            //ClassOrInterfaceBodyDeclaration
+                [ MethodDeclaration/MethodDeclarator/FormalParameters[@ParameterCount>$maximum] ]
+                [ not(Annotation/MarkerAnnotation/Name[@Image='Override']) ]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+    
+    <rule
+        name="AvoidThreadGroup"
+        since="3.6"
+        message="Avoid using java.lang.ThreadGroup; it is not thread safe"
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#AvoidThreadGroup"
+        language="java"
+        typeResolution="true"
+        >
+        <description>Avoid using java.lang.ThreadGroup; although it is intended to be used in a threaded environment it contains methods that are not thread safe.</description>
+        <priority>3</priority>
+        <properties>
+            <property name="xpath"><value>
+            <![CDATA[
+            //AllocationExpression/ClassOrInterfaceType
+                [ typeof(@Image, 'java.lang.ThreadGroup') and contains(@Image, 'ThreadGroup') ]
+            |
+            //PrimarySuffix[contains(@Image, 'getThreadGroup')]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+    
+    <rule
+        name="UseSingleton"
+    	since="3.0"
+        message="All methods are static.  Consider using Singleton instead.  Alternatively, you could add a private constructor or make the class abstract to silence this warning."
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#UseSingleton"
+        language="java"
+        >
+        <description><![CDATA[If you have a class that has nothing but static methods, consider making it a Singleton. If you want this class to be a Singleton, remember to add a private constructor to prevent instantiation.]]></description>
+        <priority>3</priority>
+        <properties>
+            <property name="xpath"><value>
+            <![CDATA[
+            //ClassOrInterfaceDeclaration[
+                @Interface='false' and @Abstract='false'
+                and not(ExtendsList)
+                and not(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/MethodDeclaration[
+                    @Private!='true' and @Static='false'
+                ]) 
+                and not(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/FieldDeclaration[
+                    @Private!='true' and @Static='false'
+                ])
+                and not(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/MethodDeclaration[
+                    @MethodName='main' and
+                    @Static='true' and
+                    @Public='true' and
+                    @Void='true' and
+                    MethodDeclarator/FormalParameters[@ParameterCount=1] and
+                    MethodDeclarator/FormalParameters/FormalParameter/Type[@Array='true' and @TypeImage='String']
+                ])
+                and (
+                    @Final='false' or
+                    count(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration)!=1
+                    or not(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[
+                        @Private='true'
+                        and FormalParameters[@ParameterCount=0]
+                    ])
+                )
+            ]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+    
+    
+    <rule
+        name="TooManyFields"
+        since="4.3"
+        message="Too many fields"
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#TooManyFields"
+        typeResolution="true"
+        language="java"
+        >
+        <description><![CDATA[Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information.  For example, a class with city/state/zip fields could instead have one Address field.]]></description>
+        <priority>3</priority>
+        <properties>
+            <property name="maxfields" type="Integer" description="The field count reporting threshold " min="1" max="1000" value="15"/>
+            <property name="xpath"><value>
+            <![CDATA[
+            //ClassOrInterfaceDeclaration[
+                count(
+                    ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/FieldDeclaration
+                    [@Final='false']
+                    [@Static='false']
+                ) > $maxfields
+            ]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+    
+    <!--
+    <rule
+        name="LexicableConstructor"
+        since="4.3"
+        message="Lexicable class must be constructable from LexicalContext"
+        class="net.sourceforge.pmd.lang.rule.XPathRule"
+        externalInfoUrl="http://java.ranides.net/docs/pmd.htm#TooManyFields"
+        typeResolution="true"
+        >
+        <description><![CDATA[Classes that implement Lexicable interface must declare apriotiate ocnstructor with signature: Construct(LexicalContext context). It can be public but this is not obligatory.]]></description>
+        <priority>3</priority>
+        <properties>
+            <property name="xpath"><value>
+            <![CDATA[
+            //ClassOrInterfaceDeclaration[
+                ImplementsList/ClassOrInterfaceType[
+                    @Image='Lexicable' or @Image='net.ranides.assira.text.Lexicable'
+                ]
+                and
+                not(ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[
+                    FormalParameters[
+                        @ParameterCount='1' 
+                        and 
+                        FormalParameter/Type[@Array='false'][@TypeImage='LexicalContext' or @TypeImage='net.ranides.assira.text.LexicalContext']
+                    ]
+                ])
+            ]
+            ]]>
+            </value></property>
+        </properties>
+    </rule>
+    -->
+
+</ruleset>

+ 226 - 0
assira.rules/src/main/resources/rulesets/java/assira.standard.xml

@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<ruleset name="net.ranides.assira.standard"
+    xmlns="http://pmd.sf.net/ruleset/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+    xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+
+    <description>
+    Assira Quality Policy - Default Inherited Rules
+    </description>
+
+    <rule ref="rulesets/java/empty.xml/EmptyCatchBlock"/>
+    <rule ref="rulesets/java/empty.xml/EmptyIfStmt"/>
+    <rule ref="rulesets/java/empty.xml/EmptyWhileStmt"/>
+    <rule ref="rulesets/java/empty.xml/EmptyTryBlock"/>
+    <rule ref="rulesets/java/empty.xml/EmptyFinallyBlock"/>
+    <rule ref="rulesets/java/empty.xml/EmptySwitchStatements"/>
+    <rule ref="rulesets/java/basic.xml/JumbledIncrementer"/>
+    <rule ref="rulesets/java/basic.xml/ForLoopShouldBeWhileLoop"/>
+    <rule ref="rulesets/java/unnecessary.xml/UnnecessaryConversionTemporary"/>
+    <rule ref="rulesets/java/basic.xml/OverrideBothEqualsAndHashcode"/>
+    <rule ref="rulesets/java/basic.xml/DoubleCheckedLocking"/>
+    <rule ref="rulesets/java/basic.xml/ReturnFromFinallyBlock"/>
+    <rule ref="rulesets/java/empty.xml/EmptySynchronizedBlock"/>
+    <rule ref="rulesets/java/unnecessary.xml/UnnecessaryReturn"/>
+    <rule ref="rulesets/java/empty.xml/EmptyStaticInitializer"/>
+    <rule ref="rulesets/java/basic.xml/UnconditionalIfStatement"/>
+    <rule ref="rulesets/java/empty.xml/EmptyStatementNotInLoop"/>
+    <rule ref="rulesets/java/basic.xml/BooleanInstantiation"/>
+    <rule ref="rulesets/java/unnecessary.xml/UnnecessaryFinalModifier"/>
+    <rule ref="rulesets/java/basic.xml/CollapsibleIfStatements"/>
+    <rule ref="rulesets/java/basic.xml/ClassCastExceptionWithToArray"/>
+    <rule ref="rulesets/java/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
+    <rule ref="rulesets/java/unnecessary.xml/UselessOperationOnImmutable"/>
+    <rule ref="rulesets/java/basic.xml/MisplacedNullCheck"/>
+    <rule ref="rulesets/java/unnecessary.xml/UnusedNullCheckInEquals"/>
+    <rule ref="rulesets/java/basic.xml/BrokenNullCheck"/>
+    <rule ref="rulesets/java/basic.xml/AvoidUsingOctalValues"/>
+    <rule ref="rulesets/java/basic.xml/AvoidUsingHardCodedIP"/>
+    <rule ref="rulesets/java/basic.xml/CheckResultSet"/>
+    <rule ref="rulesets/java/basic.xml/AvoidMultipleUnaryOperators"/>
+    
+    <rule ref="rulesets/java/empty.xml/EmptyInitializer"/>
+
+    <rule ref="rulesets/java/braces.xml"/>
+
+    <rule ref="rulesets/java/codesize.xml/NPathComplexity" />
+    <rule ref="rulesets/java/codesize.xml/ExcessiveMethodLength" />
+    <rule ref="rulesets/java/codesize.xml/ExcessiveClassLength">
+        <properties>
+            <property name="minimum" value="1000"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/codesize.xml/CyclomaticComplexity">
+        <properties>
+            <property name="showClassesComplexity" value="false"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/codesize.xml/NcssMethodCount">
+        <properties>
+            <property name="minimum" value="50"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/codesize.xml/NcssTypeCount">
+        <properties>
+            <property name="minimum" value="1000"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/codesize.xml/NcssConstructorCount">
+        <properties>
+            <property name="minimum" value="50"/>
+        </properties>
+    </rule>
+
+    <rule ref="rulesets/java/clone.xml"/>          
+
+    <rule ref="rulesets/java/unusedcode.xml/UnusedModifier"/>
+    <rule ref="rulesets/java/controversial.xml/AtLeastOneConstructor"/>
+    <rule ref="rulesets/java/controversial.xml/DontImportSun"/>
+    <rule ref="rulesets/java/controversial.xml/UnnecessaryParentheses"/>
+    <rule ref="rulesets/java/controversial.xml/DoNotCallGarbageCollectionExplicitly"/>
+
+    <rule ref="rulesets/java/coupling.xml/CouplingBetweenObjects">
+        <properties>
+            <property name="threshold" value="15"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/coupling.xml/ExcessiveImports">
+        <properties>
+            <property name="minimum" value="30"/>
+        </properties>
+    </rule>
+
+    <rule ref="rulesets/java/design.xml/SimplifyBooleanReturns" />
+    <rule ref="rulesets/java/design.xml/SimplifyBooleanExpressions" />
+    <rule ref="rulesets/java/design.xml/AvoidDeeplyNestedIfStmts" />
+    <rule ref="rulesets/java/design.xml/AvoidReassigningParameters" />
+    <rule ref="rulesets/java/design.xml/SwitchDensity">
+        <properties>
+            <property name="minimum" value="5"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/design.xml/ConstructorCallsOverridableMethod" />
+    <rule ref="rulesets/java/design.xml/FinalFieldCouldBeStatic" />
+    <rule ref="rulesets/java/design.xml/CloseResource" />
+    <rule ref="rulesets/java/design.xml/DefaultLabelNotLastInSwitchStmt" />
+    <rule ref="rulesets/java/design.xml/NonCaseLabelInSwitchStatement" />
+    <rule ref="rulesets/java/design.xml/OptimizableToArrayCall" />
+    <rule ref="rulesets/java/design.xml/BadComparison" />
+    <rule ref="rulesets/java/design.xml/EqualsNull" />
+    <rule ref="rulesets/java/design.xml/InstantiationToGetClass" />
+    <rule ref="rulesets/java/design.xml/IdempotentOperations" />
+    <rule ref="rulesets/java/design.xml/SimpleDateFormatNeedsLocale" />
+    <rule ref="rulesets/java/design.xml/ImmutableField" />
+    <rule ref="rulesets/java/design.xml/UseLocaleWithCaseConversions" />
+    <rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic" />
+    <rule ref="rulesets/java/design.xml/MissingBreakInSwitch" />
+    <rule ref="rulesets/java/design.xml/UseNotifyAllInsteadOfNotify" />
+    <rule ref="rulesets/java/design.xml/SimplifyConditional" />
+    <rule ref="rulesets/java/design.xml/CompareObjectsWithEquals" />
+    <rule ref="rulesets/java/design.xml/PositionLiteralsFirstInComparisons" />
+    <rule ref="rulesets/java/design.xml/UnnecessaryLocalBeforeReturn" />
+    <rule ref="rulesets/java/design.xml/NonThreadSafeSingleton" />
+    <!--<rule ref="rulesets/java/design.xml/UncommentedEmptyMethodBody" />-->
+    <rule ref="rulesets/java/design.xml/UnsynchronizedStaticDateFormatter" />
+    <rule ref="rulesets/java/design.xml/UseCollectionIsEmpty" />
+    <rule ref="rulesets/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal" />
+    <rule ref="rulesets/java/design.xml/SingularField" />
+    <rule ref="rulesets/java/design.xml/ReturnEmptyArrayRatherThanNull" />
+    <rule ref="rulesets/java/design.xml/TooFewBranchesForASwitchStatement">
+        <properties>
+            <property name="minimumNumberCaseForASwitch" value="3"/>
+        </properties>
+    </rule>
+
+    <rule ref="rulesets/java/finalizers.xml" />
+
+    <rule ref="rulesets/java/imports.xml/DuplicateImports" />
+    <rule ref="rulesets/java/imports.xml/DontImportJavaLang" />
+    <rule ref="rulesets/java/imports.xml/UnusedImports" />
+    <rule ref="rulesets/java/imports.xml/ImportFromSamePackage" />
+    <rule ref="rulesets/java/imports.xml/TooManyStaticImports">
+        <properties>
+            <property name="maximumStaticImports" value="3"/>
+        </properties>
+    </rule>
+
+    <rule ref="rulesets/java/javabeans.xml/MissingSerialVersionUID" />
+
+    <rule ref="rulesets/java/junit.xml/JUnitStaticSuite" />
+    <rule ref="rulesets/java/junit.xml/JUnitSpelling" />
+    <rule ref="rulesets/java/junit.xml/JUnitTestsShouldIncludeAssert" />
+    <rule ref="rulesets/java/junit.xml/TestClassWithoutTestCases" />
+    <rule ref="rulesets/java/junit.xml/UseAssertEqualsInsteadOfAssertTrue" />
+    <rule ref="rulesets/java/junit.xml/UseAssertSameInsteadOfAssertTrue" />
+    <rule ref="rulesets/java/junit.xml/UseAssertNullInsteadOfAssertTrue" />
+    <rule ref="rulesets/java/junit.xml/SimplifyBooleanAssertion" />
+
+    <rule ref="rulesets/java/logging-java.xml/LoggerIsNotStaticFinal" />
+    <rule ref="rulesets/java/logging-java.xml/SystemPrintln" />
+    <rule ref="rulesets/java/logging-jakarta-commons.xml/UseCorrectExceptionLogging" />
+    <rule ref="rulesets/java/logging-jakarta-commons.xml/ProperLogger">
+        <properties>
+            <property name="staticLoggerName" value="LOGGER"/>
+        </properties>
+    </rule>
+
+    <rule ref="rulesets/java/migrating.xml/ReplaceVectorWithList" />
+    <rule ref="rulesets/java/migrating.xml/ReplaceHashtableWithMap" />
+    <rule ref="rulesets/java/migrating.xml/ReplaceEnumerationWithIterator" />
+    <rule ref="rulesets/java/migrating.xml/AvoidEnumAsIdentifier" />
+    <rule ref="rulesets/java/migrating.xml/AvoidAssertAsIdentifier" />
+    <rule ref="rulesets/java/migrating.xml/IntegerInstantiation" />
+    <rule ref="rulesets/java/migrating.xml/ByteInstantiation" />
+    <rule ref="rulesets/java/migrating.xml/ShortInstantiation" />
+    <rule ref="rulesets/java/migrating.xml/LongInstantiation" />
+
+    <rule ref="rulesets/java/naming.xml/ClassNamingConventions" />
+    <rule ref="rulesets/java/naming.xml/MethodWithSameNameAsEnclosingClass" />
+    <rule ref="rulesets/java/naming.xml/SuspiciousHashcodeMethodName" />
+    <rule ref="rulesets/java/naming.xml/SuspiciousConstantFieldName" />
+    <rule ref="rulesets/java/naming.xml/SuspiciousEqualsMethodName" />
+    <rule ref="rulesets/java/naming.xml/AvoidFieldNameMatchingTypeName" />
+    <rule ref="rulesets/java/naming.xml/NoPackage" />
+    <rule ref="rulesets/java/naming.xml/PackageCase" />
+
+
+    <rule ref="rulesets/java/optimizations.xml/UseArrayListInsteadOfVector" />
+    <rule ref="rulesets/java/optimizations.xml/UseStringBufferForStringAppends" />
+    <rule ref="rulesets/java/optimizations.xml/UseArraysAsList" />
+    <rule ref="rulesets/java/optimizations.xml/AvoidArrayLoops" />
+    <rule ref="rulesets/java/optimizations.xml/UnnecessaryWrapperObjectCreation" />
+    <rule ref="rulesets/java/optimizations.xml/AddEmptyString" />
+
+
+    <rule ref="rulesets/java/strictexception.xml/AvoidCatchingThrowable" />
+    <rule ref="rulesets/java/strictexception.xml/ExceptionAsFlowControl" />
+    <rule ref="rulesets/java/strictexception.xml/AvoidCatchingNPE" />
+    <rule ref="rulesets/java/strictexception.xml/AvoidThrowingNullPointerException" />
+    <rule ref="rulesets/java/strictexception.xml/DoNotThrowExceptionInFinally" />
+    <rule ref="rulesets/java/strictexception.xml/AvoidThrowingNewInstanceOfSameException" />
+
+
+    <rule ref="rulesets/java/strings.xml/AvoidDuplicateLiterals">
+        <properties>
+            <property name="skipAnnotations" value="true"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/strings.xml/StringInstantiation" />
+    <rule ref="rulesets/java/strings.xml/StringToString" />
+    <rule ref="rulesets/java/strings.xml/InefficientStringBuffering" />
+    <rule ref="rulesets/java/strings.xml/UnnecessaryCaseChange" />
+    <rule ref="rulesets/java/strings.xml/UseStringBufferLength" />
+    <rule ref="rulesets/java/strings.xml/AppendCharacterWithChar" />
+    <rule ref="rulesets/java/strings.xml/ConsecutiveLiteralAppends" />
+    <rule ref="rulesets/java/strings.xml/InefficientEmptyStringCheck" />
+    <rule ref="rulesets/java/strings.xml/UselessStringValueOf" />
+    <rule ref="rulesets/java/strings.xml/StringBufferInstantiationWithChar" />
+    <rule ref="rulesets/java/strings.xml/UseEqualsToCompareStrings" />
+    <rule ref="rulesets/java/strings.xml/AvoidStringBufferField" />
+
+    <rule ref="rulesets/java/sunsecure.xml" />
+    <rule ref="rulesets/java/unusedcode.xml" />
+
+</ruleset>