-
Notifications
You must be signed in to change notification settings - Fork 28
/
checkstyle.xml
296 lines (276 loc) · 12.5 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
<!--
~ This file is part of Araknemu.
~
~ Araknemu is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Lesser General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Araknemu is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public License
~ along with Araknemu. If not, see <https://www.gnu.org/licenses/>.
~
~ Copyright (c) 2017-2021 Vincent Quatrevieux
-->
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="MissingDeprecated" />
<module name="MissingOverride" />
<module name="AnnotationLocation" />
<module name="AvoidNestedBlocks" />
<module name="EmptyBlock" />
<module name="EmptyCatchBlock" />
<module name="LeftCurly">
<property name="ignoreEnums" value="false" />
</module>
<module name="NeedBraces" />
<module name="RightCurly" />
<module name="DesignForExtension">
<!-- Ignore overridden methods ? -->
<property name="ignoredAnnotations" value="Override" />
</module>
<module name="FinalClass" />
<module name="HideUtilityClassConstructor" />
<module name="InnerTypeLast" />
<module name="InterfaceIsType" />
<module name="MutableException" />
<module name="OneTopLevelClass" />
<module name="ThrowsCount">
<property name="max" value="2" />
</module>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true" /> <!-- To remove ? Only final protected ? -->
</module>
<module name="ArrayTrailingComma" />
<!-- <module name="AvoidDoubleBraceInitialization" />-->
<module name="CovariantEquals" />
<module name="DeclarationOrder" />
<module name="DefaultComesLast" />
<module name="EmptyStatement" />
<module name="EqualsAvoidNull" />
<module name="FinalLocalVariable" />
<module name="IllegalType" />
<!-- Should be uncommented -->
<!-- TODO -->
<!-- <module name="MagicNumber">-->
<!-- <property name="ignoreHashCodeMethod" value="true" />-->
<!-- <property name="severity" value="warning"/>-->
<!-- </module>-->
<module name="ModifiedControlVariable" />
<module name="MultipleVariableDeclarations" />
<module name="NestedForDepth" />
<module name="NestedIfDepth" />
<module name="NestedTryDepth" />
<module name="NoFinalizer" />
<module name="OneStatementPerLine" />
<module name="PackageDeclaration" />
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<!-- <module name="UnnecessarySemicolonAfterOuterTypeDeclaration" />--> <!-- No supported -->
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration" />
<module name="UnnecessarySemicolonInEnumeration" />
<module name="AvoidStarImport" />
<module name="AvoidStaticImport" />
<module name="RedundantImport" />
<module name="UnusedImports" />
<module name="BooleanExpressionComplexity" />
<module name="CyclomaticComplexity" />
<module name="JavaNCSS">
<property name="severity" value="warning"/>
<property name="classMaximum" value="150" />
</module>
<module name="ArrayTypeStyle" />
<module name="CommentsIndentation" />
<module name="OuterTypeFilename" />
<module name="TodoComment">
<property name="format" value="(TODO:)|(@todo )" />
<property name="severity" value="info" />
</module>
<module name="UncommentedMain">
<property name="excludedClasses" value="Araknemu" />
</module>
<module name="UpperEll" />
<!-- <module name="ClassMemberImpliedModifier" />--> <!-- No supported -->
<module name="InterfaceMemberImpliedModifier">
<property name="violateImpliedAbstractMethod" value="false" />
</module>
<module name="ModifierOrder" />
<module name="AbstractClassName" />
<module name="ClassTypeParameterName" />
<module name="InterfaceTypeParameterName" />
<module name="ConstantName">
<property name="applyToPrivate" value="false" />
</module>
<module name="LambdaParameterName">
<!-- Allow only words or in format a1, a2, ... -->
<property name="format" value="^[a-z]([0-9]|[a-zA-Z]*)$" />
</module>
<module name="LocalFinalVariableName">
<!-- Allow only words -->
<property name="format" value="^[a-z][a-zA-Z]*$" />
</module>
<module name="LocalVariableName">
<!-- Allow only words -->
<property name="format" value="^[a-z][a-zA-Z]*$" />
</module>
<module name="MemberName">
<!-- Allow only words -->
<property name="format" value="^[a-z][a-zA-Z]*$" />
</module>
<module name="MethodName">
<!-- Allow only words -->
<property name="format" value="^([a-z][a-zA-Z]*|argon2)$" />
</module>
<module name="MethodTypeParameterName" />
<module name="PackageName">
<!-- Allow only lower case word -->
<property name="format" value="^fr.quatrevieux.araknemu(.[a-z]+)*$" />
</module>
<module name="ParameterName">
<!-- Allow only words -->
<property name="format" value="^[a-z][a-zA-Z]*$" />
</module>
<module name="StaticVariableName">
<!-- Allow only words -->
<property name="format" value="^[a-z][a-zA-Z]*$" />
</module>
<module name="TypeName">
<!-- Allow only words -->
<property name="format" value="^([A-Z][a-zA-Z]*|Argon2(Hash|Password)?)$" />
</module>
<module name="AnonInnerLength" />
<!-- <module name="LambdaBodyLength" />--> <!-- TODO after refactoring modules -->
<module name="MethodCount">
<property name="maxTotal" value="30" />
</module>
<module name="MethodLength" />
<module name="OuterTypeNumber">
<property name="max" value="1" />
</module>
<module name="ParameterNumber">
<property name="max" value="5" />
<!-- Ignore constructors -->
<property name="tokens" value="METHOD_DEF" />
</module>
<module name="EmptyForInitializerPad" />
<module name="EmptyForIteratorPad" />
<module name="GenericWhitespace" />
<module name="MethodParamPad" />
<module name="NoLineWrap" />
<module name="NoWhitespaceAfter">
<property name="tokens" value="AT, INC, DEC, BNOT, LNOT, DOT, ARRAY_DECLARATOR, INDEX_OP" />
</module>
<module name="NoWhitespaceBefore">
<property name="allowLineBreaks" value="true" />
<property name="tokens" value="COMMA, SEMI, POST_INC, POST_DEC, DOT, GENERIC_END, ELLIPSIS, METHOD_REF" />
</module>
<module name="OperatorWrap">
<property name="tokens" value="QUESTION, COLON, EQUAL, NOT_EQUAL, DIV, MINUS, STAR, MOD, SR, BSR, GE, GT, SL, LE, LT, BXOR, BOR, LOR, BAND, LAND, TYPE_EXTENSION_AND, LITERAL_INSTANCEOF" />
</module>
<module name="ParenPad" />
<module name="SeparatorWrap">
<property name="tokens" value="DOT"/>
<property name="tokens" value="AT"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="COMMA"/>
<property name="tokens" value="RBRACK"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="eol"/>
</module>
<!-- <module name="SingleSpaceSeparator" />--> <!-- Do not handle aligned statements -->
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround">
<property name="allowEmptyMethods" value="true" />
<property name="allowEmptyLambdas" value="true" />
<property name="allowEmptyConstructors" value="true" />
</module>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true" />
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false" />
<property name="allowMultipleEmptyLines" value="false" />
</module>
<module name="JavadocContentLocationCheck" />
<module name="JavadocMethod">
<property name="accessModifiers" value="public" />
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
</module>
<module name="MissingJavadocMethod">
<property name="tokens" value="METHOD_DEF, ANNOTATION_FIELD_DEF" />
<property name="minLineCount" value="1" /> <!-- TODO: should be removed -->
</module>
<!-- <module name="MissingJavadocType" />--> <!-- Cannot ignore inner class -->
<module name="NonEmptyAtclauseDescription" />
</module>
<module name="NewlineAtEndOfFile" />
<module name="FileLength">
<property name="max" value="1000" /> <!-- TODO: Should be lowered to 500 -->
</module>
<module name="FileTabCharacter" />
<module name="RegexpHeader">
<property name="headerFile" value="java.header" />
<property name="multiLines" value="18" />
</module>
<!-- Ignore magic number on packets generation -->
<module name="SuppressionSingleFilter">
<property name="checks" value="MagicNumberCheck"/>
<property name="files" value="network"/>
</module>
<!-- Ignore line number of GameModule - TODO must be refactored -->
<module name="SuppressionSingleFilter">
<property name="checks" value="FileLength"/>
<property name="files" value="GameModule"/>
</module>
<!-- Ignore modified control variable on CLI argument parsing -->
<module name="SuppressionSingleFilter">
<property name="checks" value="ModifiedControlVariableCheck"/>
<property name="files" value="admin"/>
</module>
<!-- Ignore EffectUtils : this class should be refactored -->
<module name="SuppressionSingleFilter">
<property name="checks" value="BooleanExpressionComplexityCheck"/>
<property name="files" value="EffectsUtils"/>
</module>
<!-- Ignore Modules. TODO remove after modules refactor -->
<module name="SuppressionSingleFilter">
<property name="checks" value="(MethodLengthCheck|AnonInnerLength)"/>
<property name="files" value="Module.java$"/>
</module>
<!-- Ignore entity classes -->
<module name="SuppressionSingleFilter">
<property name="checks" value="ParameterNumberCheck" />
<property name="files" value="data.*entity" />
</module>
<!-- Ignore fight classes -->
<module name="SuppressionSingleFilter">
<property name="checks" value="MethodCountCheck" />
<property name="files" value="(game.fight.Fight|out.fight.action.ActionEffect)" />
</module>
<module name="SuppressionSingleFilter">
<property name="checks" value="ParameterNumberCheck" />
<property name="files" value="game.fight.FightService" />
</module>
<!-- Network classes -->
<module name="SuppressionSingleFilter">
<property name="checks" value="AnonInnerLength" />
<property name="files" value="fr.quatrevieux.araknemu.network.game.out.game.UpdateCells" />
</module>
<!-- Ignore CastSimulation -->
<module name="SuppressionSingleFilter">
<property name="checks" value="MethodCountCheck" />
<property name="files" value="(fr.quatrevieux.araknemu.game.fight.ai.simulation.CastSimulation)" />
</module>
</module>