-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoose-pmd-rules.xml
139 lines (117 loc) · 7.1 KB
/
oose-pmd-rules.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0"?>
<ruleset name="OOSE PMD Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
PMD rules for Object Oriented Software Engineering
</description>
<exclude-pattern>.*/(build|bin)/.*</exclude-pattern>
<!-- Throwing exceptions -->
<rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes" />
<rule ref="category/java/design.xml/AvoidThrowingNullPointerException" />
<rule ref="category/java/errorprone.xml/DoNotThrowExceptionInFinally" />
<!-- Catching exception types -->
<rule ref="category/java/errorprone.xml/AvoidCatchingThrowable" />
<rule ref="category/java/design.xml/AvoidCatchingGenericException" />
<rule ref="category/java/errorprone.xml/AvoidCatchingNPE" />
<!-- Catch blocks -->
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
<rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause" />
<rule ref="category/java/errorprone.xml/AvoidLosingExceptionInformation" />
<rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace" />
<rule ref="category/java/bestpractices.xml/AvoidReassigningCatchVariables" />
<rule ref="category/java/bestpractices.xml/PreserveStackTrace" />
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches" />
<rule ref="category/java/design.xml/AvoidThrowingNewInstanceOfSameException" />
<!-- Throw declarations -->
<rule ref="category/java/design.xml/SignatureDeclareThrowsException">
<properties>
<property name="IgnoreJUnitCompletely" value="false" />
</properties>
</rule>
<!-- New exception types -->
<rule ref="category/java/errorprone.xml/DoNotExtendJavaLangThrowable" />
<!-- VM -->
<rule ref="category/java/errorprone.xml/DoNotTerminateVM" />
<!-- Almost certainly erroneous -->
<rule ref="category/java/errorprone.xml/BrokenNullCheck" />
<rule ref="category/java/errorprone.xml/ComparisonWithNaN" />
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
<!-- Cloning -->
<rule ref="category/java/errorprone.xml/CloneMethodMustBePublic" />
<rule ref="category/java/errorprone.xml/CloneMethodReturnTypeMustMatchClassName" />
<!-- Scoping -->
<rule ref="category/java/design.xml/SingularField" />
<rule ref="category/java/bestpractices.xml/UnusedAssignment" />
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter" />
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
<rule ref="category/java/codestyle.xml/CommentDefaultAccessModifier" />
<rule ref="category/java/codestyle.xml/NoPackage" />
<!-- <rule ref="category/java/codestyle.xml/PrematureDeclaration" /> -->
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
<!-- Resources -->
<rule ref="category/java/errorprone.xml/CloseResource" />
<rule ref="category/java/bestpractices.xml/UseTryWithResources" />
<!-- Objects -->
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals" />
<rule ref="category/java/errorprone.xml/EqualsNull" />
<!-- <rule ref="category/java/bestpractices.xml/AccessorClassGeneration" /> -->
<!-- Inheritance -->
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod" />
<rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod" />
<rule ref="category/java/bestpractices.xml/MissingOverride" />
<rule ref="category/java/codestyle.xml/AvoidProtectedFieldInFinalClass" />
<rule ref="category/java/codestyle.xml/AvoidProtectedMethodInFinalClassNotExtending" />
<rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract" />
<rule ref="category/java/codestyle.xml/ExtendsObject" />
<rule ref="category/java/design.xml/AbstractClassWithoutAnyMethod" />
<!-- Typing -->
<rule ref="category/java/bestpractices.xml/LooseCoupling" />
<rule ref="category/java/codestyle.xml/UnnecessaryCast" />
<!-- <rule ref="category/java/codestyle.xml/UnnecessaryModifier" /> -->
<rule ref="category/java/codestyle.xml/UseDiamondOperator" />
<!-- Naming Conventions -->
<rule ref="category/java/codestyle.xml/ClassNamingConventions" />
<rule ref="category/java/codestyle.xml/FieldNamingConventions" />
<rule ref="category/java/codestyle.xml/FormalParameterNamingConventions" />
<rule ref="category/java/codestyle.xml/GenericsNaming" />
<rule ref="category/java/codestyle.xml/LinguisticNaming" />
<rule ref="category/java/codestyle.xml/LocalVariableNamingConventions" />
<rule ref="category/java/codestyle.xml/MethodNamingConventions" />
<rule ref="category/java/codestyle.xml/PackageCase" />
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
<!-- Suspicious control constructs -->
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
<rule ref="category/java/errorprone.xml/ImplicitSwitchFallThrough" />
<rule ref="category/java/bestpractices.xml/AvoidReassigningLoopVariables" />
<rule ref="category/java/bestpractices.xml/DefaultLabelNotLastInSwitchStmt" />
<rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault" />
<rule ref="category/java/bestpractices.xml/WhileLoopWithLiteralBoolean" />
<rule ref="category/java/codestyle.xml/ConfusingTernary" />
<rule ref="category/java/codestyle.xml/ControlStatementBraces" />
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
<!-- Inefficient control constructs -->
<rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach" />
<!-- Unusual extra -->
<rule ref="category/java/errorprone.xml/AvoidCallingFinalize" />
<rule ref="category/java/errorprone.xml/DontImportSun" />
<rule ref="category/java/errorprone.xml/IdempotentOperations" />
<rule ref="category/java/codestyle.xml/AvoidDollarSigns" />
<rule ref="category/java/codestyle.xml/UnnecessaryAnnotationValueElement" />
<!-- Logging -->
<!-- rule ref="category/java/bestpractices.xml/SystemPrintln" / -->
<rule ref="category/java/bestpractices.xml/GuardLogStatement" />
</ruleset>