-
Notifications
You must be signed in to change notification settings - Fork 45
/
checkstyle.xml
447 lines (396 loc) · 18.4 KB
/
checkstyle.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://development.int.cinetic.de/daten/java/checkstyle/configuration_1_2.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
http://java.sun.com/docs/books/jls/second_edition/html/index.html
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
- the Javadoc guidelines at
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
Finally, it is worth reading the documentation.
-->
<!-- Erweitert um WEB.DE Anforderungen
$Id: webde_checks.xml 227792 2010-03-23 10:00:55Z hudson $
-->
<module name="Checker">
<property name="localeCountry" value="DE" />
<property name="localeLanguage" value="en" />
<!-- Checks that a package.html file exists for each package. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
<!-- module name="PackageHtml"/ -->
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<!-- module name="NewlineAtEndOfFile"/ -->
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation" />
<!-- Report only errors. -->
<!-- module name="SeverityMatchFilter">
<property name="severity" value="warning"/>
<property name="acceptOnMatch" value="false"/>
</module -->
<!-- rz: leider kann das simian immer noch besser
<module name="StrictDuplicateCode"/>-->
<!-- Nur fuer Unittests
<module name="TreeWalker">
<module name="de.web.tools.checkstyle.checker.ValidUnittestCheck">
<property name="severity" value="error" />
</module>
</module>
-->
<module name="SuppressionCommentFilter"/>
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="FileContentsHolder"/>
<module name="JavadocMethod">
<property name="severity" value="info" />
<property name="scope" value="private" />
<property name="allowMissingPropertyJavadoc" value="true" />
<property name="allowUndeclaredRTE" value="true"/>
</module>
<module name="JavadocMethod">
<property name="severity" value="error" />
<property name="scope" value="public" />
<property name="allowMissingPropertyJavadoc" value="true" />
<property name="allowUndeclaredRTE" value="true"/>
</module>
<module name="JavadocType">
<property name="severity" value="error" />
<property name="scope" value="public" />
</module>
<!--
<module name="JavadocVariable">
<property name="severity" value="info"/>
</module>
-->
<module name="JavadocStyle">
<property name="severity" value="warning" />
<property name="checkFirstSentence" value="false" />
<property name="checkHtml" value="false" />
</module>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName">
<property name="severity" value="error" />
</module>
<module name="LocalFinalVariableName">
<property name="severity" value="error" />
</module>
<module name="LocalVariableName">
<property name="severity" value="error" />
</module>
<module name="MemberName">
<property name="severity" value="error" />
</module>
<module name="MethodName">
<property name="severity" value="error" />
</module>
<module name="PackageName">
<property name="severity" value="error" />
</module>
<module name="ParameterName">
<property name="severity" value="error" />
</module>
<module name="StaticVariableName">
<property name="severity" value="error" />
</module>
<module name="TypeName">
<property name="severity" value="error" />
</module>
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport">
<property name="severity" value="error" />
<property name="excludes" value="java.io,java.net" />
</module>
<module name="IllegalImport"><!-- defaults to sun.* packages -->
<property name="severity" value="error" />
</module>
<module name="RedundantImport">
<property name="severity" value="warning" />
</module>
<module name="UnusedImports">
<property name="severity" value="warning" />
</module>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<!-- property name="tabWidth" value="4"/ -->
<property name="max" value="130" />
<property name="severity" value="error" />
</module>
<!-- module name="FileLength"/ -->
<!-- module name="MethodLength"/ -->
<!-- module name="ParameterNumber"/ -->
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!--
QSIKA: Check in Checkstyle 2.5 durch FileTabCharacter ersetzt. Dieser
FileTabCharackter Check darf sich nicht innerhalb des Tree Walker
befinden.
-->
<!--module name="TabCharacter">
<property name="severity" value="error" />
</module-->
<!-- module name="EmptyForIteratorPad"/ -->
<!-- module name="MethodParamPad"/ -->
<!-- module name="NoWhitespaceAfter"/ -->
<!-- module name="NoWhitespaceBefore"/ -->
<!-- module name="OperatorWrap"/ -->
<!-- module name="ParenPad"/ -->
<!-- module name="TypecastParenPad"/ -->
<!-- module name="WhitespaceAround"/ -->
<!-- module name="WhitespaceAfter"/ -->
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks">
<property name="severity" value="warning" />
</module>
<module name="NeedBraces">
<property name="severity" value="warning" />
</module>
<!-- module name="EmptyBlock"/ -->
<!-- module name="LeftCurly"/ -->
<!-- module name="RightCurly"/ -->
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- (rz) Nein, das ist nicht das, was ich wollte
Entdeckt: u = x ? y : z
ich wollte Zuweisungen in Bedingungen entdecken.
<module name="AvoidInlineConditionals">
<property name="severity" value="info" />
</module>
-->
<module name="CovariantEquals">
<property name="severity" value="error"/>
</module>
<module name="DefaultComesLast">
<property name="severity" value="error" />
</module>
<module name="EmptyStatement">
<property name="severity" value="warning" />
</module>
<!-- Vergleiche auch findbugs, das muss so sein! (rz) -->
<module name="EqualsHashCode">
<property name="severity" value="error"/>
</module>
<module name="FallThrough">
<property name="severity" value="error" />
</module>
<module name="IllegalInstantiation">
<property name="severity" value="warning" />
</module>
<module name="InnerAssignment">
<property name="severity" value="warning" />
</module>
<!-- Vergleiche http://checkstyle.sourceforge.net/config_coding.html#IllegalCatch -->
<!-- Warning bei java.lang.Exception, java.lang.RuntimeException -->
<module name="IllegalCatch">
<property name="severity" value="warning" />
<property name="illegalClassNames"
value="java.lang.Exception, java.lang.RuntimeException" />
</module>
<!-- Error bei java.lang.Throwable, java.lang.Error -->
<module name="IllegalCatch">
<property name="severity" value="error" />
<property name="illegalClassNames" value="java.lang.Throwable, java.lang.Error" />
</module>
<!-- (rz) Zu viele "False Positives"
<module name="MagicNumber">
<property name="severity" value="info" />
</module>
-->
<module name="MissingSwitchDefault">
<property name="severity" value="error" />
</module>
<module name="ModifiedControlVariable">
<property name="severity" value="warning" />
</module>
<!-- (rz) Zu viele "False Positives"
<module name="MultipleStringLiterals">
<property name="severity" value="info" />
</module>
-->
<module name="MultipleVariableDeclarations">
<property name="severity" value="warning" />
</module>
<!-- NestedIfDepth: http://checkstyle.sourceforge.net/config_coding.html -->
<module name="NestedIfDepth">
<property name="severity" value="warning" />
<property name="max" value="3" />
</module>
<module name="PackageDeclaration">
<property name="severity" value="error" />
</module>
<module name="ParameterAssignment">
<property name="severity" value="warning" />
</module>
<!-- (rz) Funktioniert nicht. Verwendung wirft selbst exceptions
<module name="RedundantThrows">
<property name="severity" value="info" />
</module>
-->
<module name="ReturnCount">
<property name="severity" value="warning" />
<property name="max" value="3" />
</module>
<module name="SimplifyBooleanExpression">
<property name="severity" value="info" />
</module>
<module name="SimplifyBooleanReturn">
<property name="severity" value="info" />
</module>
<module name="StringLiteralEquality">
<property name="severity" value="error" />
</module>
<!--
<module name="MissingCtor">
<property name="severity" value="warning"/>
</module>
-->
<!-- module name="DoubleCheckedLocking">
<property name="severity" value="warning"/>
</module -->
<!--
<module name="HiddenField">
<property name="severity" value="warning"/>
<property name="ignoreSetter" value="true"/>
<property name="ignoreConstructorParameter" value="true"/>
</module>
-->
<!-- module name="SuperClone">
<property name="severity" value="warning"/>
</module -->
<!-- module name="SuperFinalize">
<property name="severity" value="warning"/>
</module -->
<module name="UnnecessaryParentheses">
<property name="severity" value="info" />
</module>
<module name="CyclomaticComplexity">
<property name="severity" value="info" />
<property name="max" value="10" />
</module>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="TodoComment">
<property name="severity" value="info" />
<property name="format" value="TODO|FIXME|todo|XXX" />
</module>
<module name="UpperEll">
<property name="severity" value="warning" />
</module>
<!-- module name="ArrayTypeStyle"/ -->
<!-- module name="FinalParameters"/ -->
<!-- module name="GenericIllegalRegexp">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module -->
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<!-- module name="ModifierOrder"/ -->
<!-- module name="RedundantModifier"/ -->
<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. See property -->
<!-- expansion, -->
<!-- http://checkstyle.sf.net/config.html#properties -->
<!-- <property -->
<!-- name="headerFile" -->
<!-- value="${basedir}/java.header"/> -->
<!-- </module> -->
<!-- Following interprets the header file as regular expressions. -->
<!-- <module name="RegexpHeader"/> -->
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!-- module name="DesignForExtension"/ -->
<!-- module name="FinalClass"/ -->
<!-- module name="HideUtilityClassConstructor"/ -->
<!-- module name="InterfaceIsType"/ -->
<!-- module name="VisibilityModifier"/ -->
<!-- System.[out|err].print[ln] Verboten -->
<module name="UpperEll" />
<module name="RegexpSinglelineJava">
<property name="severity" value="error" />
<property name="format" value="System\.out\.print" />
<property name="ignoreCase" value="true" />
<property name="ignoreComments" value="true" />
<property name="message" value="System.out.print[ln] ist verboten. Ausgaben bitte via Logging" />
</module>
<module name="RegexpSinglelineJava">
<property name="severity" value="error" />
<property name="format" value="System\.err\.print" />
<property name="ignoreCase" value="true" />
<property name="ignoreComments" value="true" />
<property name="message" value="System.err.print[ln] ist verboten. Ausgaben bitte via Logging" />
</module>
<!-- System.gc() Verboten -->
<module name="RegexpSinglelineJava">
<property name="severity" value="error" />
<property name="format" value="System\.gc" />
<property name="ignoreCase" value="true" />
<property name="ignoreComments" value="true" />
<property name="message" value="System.gc hat keinen Effekt. Die JVM weiss selbst wann der Garbage Collector laufen sollte" />
</module>
<!--
printStackTrace Verboten Ausnahme: wenn ein Stream übergeben wird Bsp: printStackTrace(myStream) (vergl. Unddu)
-->
<module name="RegexpSinglelineJava">
<property name="severity" value="error" />
<property name="format" value="printStackTrace\s*\(\s*\)" />
<property name="ignoreCase" value="true" />
<property name="ignoreComments" value="true" />
<property name="message"
value="printStackTrace() ist verboten. Informationen zu Exceptions bitte mittels Logging erfassen. Vergl. JavaStyleGuide [LOGEXC]" />
</module>
<!-- WARNING Level -->
<!-- serialVersionUID vorerst vermeiden -->
<module name="RegexpSinglelineJava">
<property name="severity" value="warning" />
<property name="format" value="serialVersionUID" />
<property name="message"
value="Verwendung von serialVersionUID vorerst vermeiden. Details siehe http://development.webde.local/dev_wiki/JavaStyleGuide/BestPractise#serialVersionUID" />
</module>
<!-- Class.forName(x) vermeiden -->
<module name="RegexpSinglelineJava">
<property name="severity" value="warning" />
<property name="format" value="Class\.forName\([^,]*\);$" />
<property name="message"
value="Class.forName(x) vermeiden. Bitte forName mit 3 Parametern benutzen: Class.forName(x, true, this.getClass().getClassLoader()). Details siehe http://development.webde.local/dev_wiki/JavaStyleGuide/BestPractise#donot bzw. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4971254" />
</module>
<!-- INFO Level -->
<!--
Report von CLOVER:[OFF|ON] TODO: besser, wenn möglich: Jedem OFF muss innerhalb derselben Klasse ein ON folgen
-->
<!-- module name="RegexpMultiline">
<property name="severity" value="info"/>
</module-->
<module name="RegexpSinglelineJava">
<property name="severity" value="info" />
<property name="format" value="//( )*/CLOVER:OFF" />
<property name="message" value="Code-Coverage abgeschaltet (Clover Off)" />
</module>
<module name="RegexpSinglelineJava">
<property name="severity" value="info" />
<property name="format" value="//( )*/CLOVER:ON" />
<property name="message" value="Code-Coverage eingeschaltet (Clover On)" />
</module>
</module>
<module name="FileTabCharacter">
<property name="severity" value="error" />
<property name="eachLine" value="true" />
</module>
</module>