|
26 | 26 | <rule ref="category/java/bestpractices.xml"> |
27 | 27 | <exclude name="GuardLogStatement"/> |
28 | 28 | </rule> |
29 | | - <rule ref="category/java/bestpractices.xml/UnusedFormalParameter"> |
30 | | - <properties> |
31 | | - <property name="violationSuppressXPath"> |
32 | | - <value> |
33 | | - .[ |
34 | | - (ancestor::MethodDeclaration/@MethodName = 'ensureInitializationAtStartup') and ancestor-or-self::FormalParameter[ |
35 | | - Annotation[typeIsExactly('javax.enterprise.event.Observes')] |
36 | | - and Annotation[typeIsExactly('javax.enterprise.context.Initialized')]] |
37 | | - ] |
38 | | - </value> |
39 | | - </property> |
40 | | - </properties> |
41 | | - </rule> |
42 | | - <rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"> |
43 | | - <properties> |
44 | | - <property name="ignoredAnnotations" value=" |
45 | | - javax.annotation.PostConstruct | |
46 | | - javax.annotation.PreDestroy | |
47 | | - javax.enterprise.inject.Produces | |
48 | | - javax.inject.Inject |
49 | | - "/> |
50 | | - <property name="violationSuppressXPath"> |
51 | | - <value> |
52 | | - .[ |
53 | | - descendant::FormalParameter/Annotation[typeIsExactly('javax.enterprise.event.Observes')] |
54 | | - ] |
55 | | - </value> |
56 | | - </property> |
57 | | - </properties> |
58 | | - </rule> |
| 29 | + |
59 | 30 | <rule ref="category/java/codestyle.xml"> |
60 | 31 | <exclude name="AtLeastOneConstructor"/> |
61 | 32 | <exclude name="CallSuperInConstructor"/> |
|
66 | 37 | <exclude name="TooManyStaticImports"/> |
67 | 38 | <exclude name="UselessParentheses"/> |
68 | 39 | </rule> |
69 | | - <rule ref="category/java/codestyle.xml/ClassNamingConventions"/> |
| 40 | + |
70 | 41 | <rule ref="category/java/codestyle.xml/DefaultPackage"> |
71 | 42 | <properties> |
72 | 43 | <property name="violationSuppressXPath"> |
|
75 | 46 | ((MethodDeclaration/@MethodName = 'ensureInitializationAtStartup') and descendant::FormalParameter[ |
76 | 47 | Annotation[typeIsExactly('javax.enterprise.event.Observes')] |
77 | 48 | and Annotation[typeIsExactly('javax.enterprise.context.Initialized')]]) |
78 | | - or (Annotation[typeIsExactly('javax.enterprise.inject.Produces')] |
79 | | - or Annotation[typeIsExactly('javax.inject.Inject')] |
80 | | - or Annotation[typeIsExactly('javax.annotation.PostConstruct')] |
81 | | - or Annotation[typeIsExactly('javax.annotation.PreDestroy')]) |
| 49 | + or Annotation[typeIsExactly('javax.enterprise.inject.Produces')] |
| 50 | + or Annotation[typeIsExactly('javax.inject.Inject')] |
| 51 | + or Annotation[typeIsExactly('javax.annotation.PostConstruct')] |
| 52 | + or Annotation[typeIsExactly('javax.annotation.PreDestroy')] |
82 | 53 | ] |
83 | 54 | </value> |
84 | 55 | </property> |
85 | 56 | </properties> |
86 | 57 | </rule> |
| 58 | + |
87 | 59 | <rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract"> |
88 | 60 | <properties> |
89 | 61 | <property name="violationSuppressXPath"> |
|
93 | 65 | Annotation[typeIsExactly('javax.enterprise.event.Observes')] |
94 | 66 | and Annotation[typeIsExactly('javax.enterprise.context.Initialized')]]) |
95 | 67 | or (((@MethodName = 'expression') |
96 | | - or (@MethodName = 'optional') |
97 | | - or (@MethodName = 'placeholder') |
98 | | - or (@MethodName = 'placeholderWithWhitespace') |
99 | | - or (@MethodName = 'alternatives') |
100 | | - or (@MethodName = 'literal')) |
| 68 | + or (@MethodName = 'optional') |
| 69 | + or (@MethodName = 'placeholder') |
| 70 | + or (@MethodName = 'placeholderWithWhitespace') |
| 71 | + or (@MethodName = 'alternatives') |
| 72 | + or (@MethodName = 'literal')) |
101 | 73 | and ancestor::ClassOrInterfaceDeclaration[typeIsExactly('net.kautler.command.usage.UsageParserRuleContext')]) |
102 | 74 | ] |
103 | 75 | </value> |
104 | 76 | </property> |
105 | 77 | </properties> |
106 | 78 | </rule> |
| 79 | + |
107 | 80 | <rule ref="category/java/codestyle.xml/FieldNamingConventions"> |
108 | 81 | <properties> |
109 | 82 | <property name="publicConstantPattern" value="[a-z][a-zA-Z0-9]*|[A-Z][A-Z_0-9]*"/> |
110 | 83 | <property name="constantPattern" value="[a-z][a-zA-Z0-9]*|[A-Z][A-Z_0-9]*"/> |
111 | 84 | </properties> |
112 | 85 | </rule> |
| 86 | + |
113 | 87 | <rule ref="category/java/codestyle.xml/FormalParameterNamingConventions"> |
114 | 88 | <properties> |
115 | 89 | <property name="lambdaParameterPattern" value="[a-z][a-zA-Z0-9]*|__+" /> |
116 | 90 | </properties> |
117 | 91 | </rule> |
| 92 | + |
118 | 93 | <rule ref="category/java/codestyle.xml/LinguisticNaming"> |
119 | 94 | <properties> |
120 | 95 | <property name="violationSuppressXPath"> |
|
127 | 102 | </property> |
128 | 103 | </properties> |
129 | 104 | </rule> |
| 105 | + |
130 | 106 | <rule ref="category/java/codestyle.xml/LongVariable"> |
131 | 107 | <properties> |
132 | 108 | <property name="minimum" value="45"/> |
133 | 109 | </properties> |
134 | 110 | </rule> |
| 111 | + |
135 | 112 | <rule ref="category/java/codestyle.xml/ShortMethodName"> |
136 | 113 | <properties> |
137 | 114 | <property name="violationSuppressXPath"> |
|
143 | 120 | </property> |
144 | 121 | </properties> |
145 | 122 | </rule> |
| 123 | + |
146 | 124 | <rule ref="category/java/design.xml"> |
147 | 125 | <exclude name="AvoidCatchingGenericException"/> |
148 | 126 | <exclude name="ExcessiveImports"/> |
149 | 127 | <exclude name="LawOfDemeter"/> |
150 | 128 | <exclude name="LoosePackageCoupling"/> |
151 | 129 | </rule> |
152 | | - <rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"> |
153 | | - <properties> |
154 | | - <property name="violationSuppressXPath"> |
155 | | - <value> |
156 | | - .[ |
157 | | - ancestor::TypeDeclaration/Annotation[ |
158 | | - typeIsExactly('javax.enterprise.context.ApplicationScoped') |
159 | | - or typeIsExactly('javax.enterprise.context.Dependent')] |
160 | | - ] |
161 | | - </value> |
162 | | - </property> |
163 | | - </properties> |
164 | | - </rule> |
| 130 | + |
165 | 131 | <rule ref="category/java/design.xml/DataClass"> |
166 | 132 | <properties> |
167 | 133 | <property name="violationSuppressXPath"> |
168 | 134 | <value> |
169 | 135 | <!-- typeIs('java.lang.Exception') is a work-around for https://github.com/pmd/pmd/issues/2246 --> |
170 | 136 | .[ |
171 | 137 | typeIsExactly('net.kautler.command.api.Version') |
172 | | - or typeIsExactly('net.kautler.test.pitest.ExplicitMutationFilterDetails') |
173 | 138 | or typeIs('java.lang.Exception') |
174 | 139 | ] |
175 | 140 | </value> |
176 | 141 | </property> |
177 | 142 | </properties> |
178 | 143 | </rule> |
| 144 | + |
179 | 145 | <rule ref="category/java/design.xml/SignatureDeclareThrowsException"> |
180 | 146 | <properties> |
181 | 147 | <property name="violationSuppressXPath"> |
|
188 | 154 | </property> |
189 | 155 | </properties> |
190 | 156 | </rule> |
| 157 | + |
191 | 158 | <rule ref="category/java/design.xml/TooManyMethods"> |
192 | 159 | <properties> |
193 | 160 | <property name="maxmethods" value="15"/> |
194 | 161 | </properties> |
195 | 162 | </rule> |
| 163 | + |
196 | 164 | <rule ref="category/java/documentation.xml"/> |
| 165 | + |
197 | 166 | <rule ref="category/java/documentation.xml/CommentSize"> |
198 | 167 | <properties> |
199 | 168 | <property name="maxLines" value="99999"/> |
200 | 169 | <property name="maxLineLength" value="120"/> |
201 | 170 | </properties> |
202 | 171 | </rule> |
| 172 | + |
203 | 173 | <rule ref="category/java/errorprone.xml"> |
204 | 174 | <exclude name="BeanMembersShouldSerialize"/> |
205 | 175 | </rule> |
| 176 | + |
206 | 177 | <rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals"> |
207 | 178 | <properties> |
208 | 179 | <property name="violationSuppressXPath"> |
|
215 | 186 | </property> |
216 | 187 | </properties> |
217 | 188 | </rule> |
| 189 | + |
218 | 190 | <rule ref="category/java/errorprone.xml/AvoidFieldNameMatchingTypeName"> |
219 | 191 | <properties> |
220 | 192 | <property name="violationSuppressXPath"> |
|
226 | 198 | </property> |
227 | 199 | </properties> |
228 | 200 | </rule> |
| 201 | + |
229 | 202 | <rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition"> |
230 | 203 | <properties> |
231 | 204 | <property name="ignoreMagicNumbers" value="-1, 0, 1"/> |
|
239 | 212 | </property> |
240 | 213 | </properties> |
241 | 214 | </rule> |
| 215 | + |
242 | 216 | <rule ref="category/java/errorprone.xml/AvoidLosingExceptionInformation"> |
243 | 217 | <properties> |
244 | 218 | <property name="violationSuppressXPath"> |
|
251 | 225 | </property> |
252 | 226 | </properties> |
253 | 227 | </rule> |
| 228 | + |
254 | 229 | <rule ref="category/java/errorprone.xml/DataflowAnomalyAnalysis"> |
255 | 230 | <properties> |
256 | 231 | <!-- false positives --> |
257 | 232 | <property name="violationSuppressRegex"> |
258 | 233 | <value>(?x) |
259 | 234 | \QFound 'UR'-anomaly for variable \E.* | |
260 | | - \QFound 'DU'-anomaly for variable 'first' (lines '\E.* | |
261 | 235 | \QFound 'DD'-anomaly for variable 'groupName' (lines '\E.* | |
262 | | - \QFound 'DU'-anomaly for variable 'leftHasWhitespace' (lines '\E.* | |
263 | | - \QFound 'DU'-anomaly for variable 'leftOptional' (lines '\E.* | |
264 | | - \QFound 'DU'-anomaly for variable 'noneOf' (lines '\E.* | |
265 | | - \QFound 'DU'-anomaly for variable 'outer' (lines '\E.* | |
266 | 236 | \QFound 'DU'-anomaly for variable 'restrictionPolicy' (lines '\E.* | |
267 | | - \QFound 'DU'-anomaly for variable 'result' (lines '\E.* | |
268 | 237 | \QFound 'DU'-anomaly for variable 'usageTree' (lines '\E.* | |
269 | 238 | \QFound 'DU'-anomaly for variable 'seen' (lines '\E.* | |
270 | | - \QFound 'DD'-anomaly for variable 'distance' (lines '\E.* | |
271 | 239 | \QFound 'DU'-anomaly for variable 'channelId' (lines '\E.* | |
272 | 240 | \QFound 'DU'-anomaly for variable 'roleId' (lines '\E.* | |
273 | 241 | \QFound 'DU'-anomaly for variable 'userId' (lines '\E.* | |
|
277 | 245 | </property> |
278 | 246 | </properties> |
279 | 247 | </rule> |
280 | | - <rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass"/> |
| 248 | + |
281 | 249 | <rule ref="category/java/errorprone.xml/NullAssignment"> |
282 | 250 | <properties> |
283 | 251 | <property name="violationSuppressXPath"> |
|
291 | 259 | </property> |
292 | 260 | </properties> |
293 | 261 | </rule> |
| 262 | + |
294 | 263 | <rule ref="category/java/multithreading.xml"> |
295 | 264 | <exclude name="DoNotUseThreads"/> |
296 | 265 | <exclude name="UseConcurrentHashMap"/> |
297 | 266 | </rule> |
| 267 | + |
298 | 268 | <rule ref="category/java/performance.xml"/> |
| 269 | + |
299 | 270 | <rule ref="category/java/security.xml"/> |
300 | 271 | </ruleset> |
0 commit comments