1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <ruleset name =" Default PMD Ruleset"
3
+ xmlns =" http://pmd.sourceforge.net/ruleset/2.0.0"
4
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
+ xsi : schemaLocation =" http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd" >
6
+
7
+ <description >Default PMD ruleset with commonly used rules</description >
8
+
9
+ <!-- Java Best Practices -->
10
+ <rule ref =" category/java/bestpractices.xml/AvoidReassigningParameters" />
11
+ <rule ref =" category/java/bestpractices.xml/CheckResultSet" />
12
+ <rule ref =" category/java/bestpractices.xml/JUnitTestsShouldIncludeAssert" />
13
+ <rule ref =" category/java/bestpractices.xml/OneDeclarationPerLine" />
14
+ <rule ref =" category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault" />
15
+ <rule ref =" category/java/bestpractices.xml/UnusedImports" />
16
+ <rule ref =" category/java/bestpractices.xml/UnusedLocalVariable" />
17
+ <rule ref =" category/java/bestpractices.xml/UnusedPrivateField" />
18
+ <rule ref =" category/java/bestpractices.xml/UnusedPrivateMethod" />
19
+
20
+ <!-- Java Code Style -->
21
+ <rule ref =" category/java/codestyle.xml/ClassNamingConventions" >
22
+ <properties >
23
+ <property name =" classPattern" value =" [A-Z][a-zA-Z0-9]*" />
24
+ <property name =" abstractClassPattern" value =" Abstract[A-Z][a-zA-Z0-9]*" />
25
+ <property name =" interfacePattern" value =" [A-Z][a-zA-Z0-9]*" />
26
+ <property name =" enumPattern" value =" [A-Z][a-zA-Z0-9]*" />
27
+ <property name =" annotationPattern" value =" [A-Z][a-zA-Z0-9]*" />
28
+ </properties >
29
+ </rule >
30
+ <rule ref =" category/java/codestyle.xml/MethodNamingConventions" >
31
+ <properties >
32
+ <property name =" methodPattern" value =" [a-z][a-zA-Z0-9]*" />
33
+ <property name =" staticPattern" value =" [a-z][a-zA-Z0-9]*" />
34
+ <property name =" nativePattern" value =" [a-z][a-zA-Z0-9]*" />
35
+ </properties >
36
+ </rule >
37
+ <rule ref =" category/java/codestyle.xml/DefaultPackage" />
38
+ <rule ref =" category/java/codestyle.xml/DontImportJavaLang" />
39
+ <rule ref =" category/java/codestyle.xml/ExtendsObject" />
40
+ <rule ref =" category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass" />
41
+ <rule ref =" category/java/codestyle.xml/GenericsNaming" />
42
+ <rule ref =" category/java/codestyle.xml/NoPackage" />
43
+ <rule ref =" category/java/codestyle.xml/PackageCase" />
44
+
45
+ <!-- Java Design -->
46
+ <rule ref =" category/java/design.xml/AvoidThrowingNullPointerException" />
47
+ <rule ref =" category/java/design.xml/AvoidThrowingRawExceptionTypes" />
48
+ <rule ref =" category/java/design.xml/CollapsibleIfStatements" />
49
+ <rule ref =" category/java/design.xml/ExcessiveClassLength" >
50
+ <properties >
51
+ <property name =" minimum" value =" 1000" />
52
+ </properties >
53
+ </rule >
54
+ <rule ref =" category/java/design.xml/ExcessiveMethodLength" >
55
+ <properties >
56
+ <property name =" minimum" value =" 50" />
57
+ </properties >
58
+ </rule >
59
+ <rule ref =" category/java/design.xml/ExcessiveParameterList" >
60
+ <properties >
61
+ <property name =" minimum" value =" 10" />
62
+ </properties >
63
+ </rule >
64
+ <rule ref =" category/java/design.xml/SimplifyBooleanReturns" />
65
+ <rule ref =" category/java/design.xml/SimplifyBooleanExpressions" />
66
+
67
+ <!-- Java Error Prone -->
68
+ <rule ref =" category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
69
+ <rule ref =" category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" />
70
+ <rule ref =" category/java/errorprone.xml/AvoidMultipleUnaryOperators" />
71
+ <rule ref =" category/java/errorprone.xml/AvoidCallingFinalize" />
72
+ <rule ref =" category/java/errorprone.xml/EmptyIfStmt" />
73
+ <rule ref =" category/java/errorprone.xml/EmptyTryBlock" />
74
+ <rule ref =" category/java/errorprone.xml/EmptyFinallyBlock" />
75
+ <rule ref =" category/java/errorprone.xml/EmptyWhileStmt" />
76
+ <rule ref =" category/java/errorprone.xml/CompareObjectsWithEquals" />
77
+ <rule ref =" category/java/errorprone.xml/UseEqualsToCompareStrings" />
78
+
79
+ <!-- Java Performance -->
80
+ <rule ref =" category/java/performance.xml/BooleanInstantiation" />
81
+ <rule ref =" category/java/performance.xml/StringInstantiation" />
82
+ <rule ref =" category/java/performance.xml/StringToString" />
83
+ <rule ref =" category/java/performance.xml/UseStringBufferLength" />
84
+
85
+ <!-- Java Documentation -->
86
+ <rule ref =" category/java/documentation.xml/UncommentedEmptyMethodBody" />
87
+
88
+ <!-- JavaScript Best Practices -->
89
+ <rule ref =" category/ecmascript/bestpractices.xml/AvoidWithStatement" />
90
+ <rule ref =" category/ecmascript/bestpractices.xml/ConsistentReturn" />
91
+ <rule ref =" category/ecmascript/bestpractices.xml/UseBaseWithParseInt" />
92
+
93
+ <!-- JSP Design -->
94
+ <rule ref =" category/jsp/design.xml/NoInlineScript" />
95
+ <rule ref =" category/jsp/design.xml/NoInlineStyleInformation" />
96
+ <rule ref =" category/jsp/design.xml/NoScriptlets" />
97
+
98
+ <!-- XML Error Prone -->
99
+ <rule ref =" category/xml/errorprone.xml/MistypedCDATASection" />
100
+
101
+ </ruleset >
0 commit comments