|
10 | 10 | </description> |
11 | 11 |
|
12 | 12 | <!-- Best Practices --> |
13 | | - <rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod"/> |
14 | | - <rule ref="category/java/bestpractices.xml/AccessorClassGeneration"/> |
15 | | - <rule ref="category/java/bestpractices.xml/AccessorMethodGeneration"/> |
16 | | - <rule ref="category/java/bestpractices.xml/ArrayIsStoredDirectly"/> |
17 | | - <rule ref="category/java/bestpractices.xml/AvoidMessageDigestField"/> |
18 | | - <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace"/> |
19 | | - <rule ref="category/java/bestpractices.xml/AvoidReassigningCatchVariables"/> |
20 | | - <rule ref="category/java/bestpractices.xml/AvoidReassigningLoopVariables"/> |
21 | | - <rule ref="category/java/bestpractices.xml/AvoidReassigningParameters"/> |
22 | | - <rule ref="category/java/bestpractices.xml/AvoidStringBufferField"/> |
23 | | - <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/> |
24 | | - <rule ref="category/java/bestpractices.xml/CheckResultSet"/> |
25 | | - <rule ref="category/java/bestpractices.xml/ConstantsInInterface"/> |
26 | | - <rule ref="category/java/bestpractices.xml/DefaultLabelNotLastInSwitch"/> |
27 | | - <rule ref="category/java/bestpractices.xml/DoubleBraceInitialization"/> |
28 | | - <rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach"/> |
29 | | - <rule ref="category/java/bestpractices.xml/ForLoopVariableCount"/> |
30 | | - <rule ref="category/java/bestpractices.xml/GuardLogStatement"/> |
31 | | - <rule ref="category/java/bestpractices.xml/JUnit5TestShouldBePackagePrivate"/> |
32 | | - <rule ref="category/java/bestpractices.xml/UnitTestAssertionsShouldIncludeMessage"/> |
| 13 | + <rule ref="category/java/bestpractices.xml"> |
| 14 | + <exclude name="UnitTestContainsTooManyAsserts"/> <!--customized below--> |
| 15 | + </rule> |
33 | 16 | <rule ref="category/java/bestpractices.xml/UnitTestContainsTooManyAsserts"> |
34 | 17 | <properties> |
35 | 18 | <property name="maximumAsserts" value="7"/> |
36 | 19 | </properties> |
37 | 20 | </rule> |
38 | | - <rule ref="category/java/bestpractices.xml/LiteralsFirstInComparisons"/> |
39 | | - <rule ref="category/java/bestpractices.xml/LooseCoupling"/> |
40 | | - <rule ref="category/java/bestpractices.xml/MethodReturnsInternalArray"/> |
41 | | - <rule ref="category/java/bestpractices.xml/MissingOverride"/> |
42 | | - <rule ref="category/java/bestpractices.xml/OneDeclarationPerLine"/> |
43 | | - <rule ref="category/java/bestpractices.xml/PreserveStackTrace"/> |
44 | | - <rule ref="category/java/bestpractices.xml/PrimitiveWrapperInstantiation"/> |
45 | | - <rule ref="category/java/bestpractices.xml/ReplaceEnumerationWithIterator"/> |
46 | | - <rule ref="category/java/bestpractices.xml/ReplaceHashtableWithMap"/> |
47 | | - <rule ref="category/java/bestpractices.xml/ReplaceVectorWithList"/> |
48 | | - <rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion"/> |
49 | | - <rule ref="category/java/bestpractices.xml/NonExhaustiveSwitch"/> |
50 | | - <rule ref="category/java/bestpractices.xml/SystemPrintln"/> |
51 | | - <rule ref="category/java/bestpractices.xml/UnnecessaryVarargsArrayCreation"/> |
52 | | - <rule ref="category/java/bestpractices.xml/UnusedAssignment"/> |
53 | | - <rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/> |
54 | | - <rule ref="category/java/bestpractices.xml/UnusedLocalVariable"/> |
55 | | - <rule ref="category/java/bestpractices.xml/UnusedPrivateField"/> |
56 | | - <rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/> |
57 | | - <rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/> |
58 | | - <rule ref="category/java/bestpractices.xml/UseEnumCollections"/> |
59 | | - <rule ref="category/java/bestpractices.xml/UseStandardCharsets"/> |
60 | | - <rule ref="category/java/bestpractices.xml/UseTryWithResources"/> |
61 | | - <rule ref="category/java/bestpractices.xml/UseVarargs"/> |
62 | | - <rule ref="category/java/bestpractices.xml/WhileLoopWithLiteralBoolean"/> |
63 | 21 | <!-- Best Practices --> |
64 | 22 |
|
65 | 23 | <!-- Code Style --> |
66 | | - <rule ref="category/java/codestyle.xml/AvoidDollarSigns"/> |
67 | | - <rule ref="category/java/codestyle.xml/AvoidProtectedFieldInFinalClass"/> |
68 | | - <rule ref="category/java/codestyle.xml/AvoidProtectedMethodInFinalClassNotExtending"/> |
69 | | - <rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/> |
70 | | - <rule ref="category/java/codestyle.xml/BooleanGetMethodName"/> |
71 | | - <rule ref="category/java/codestyle.xml/ClassNamingConventions"/> |
72 | | - <rule ref="category/java/codestyle.xml/ConfusingTernary"/> |
73 | | - <rule ref="category/java/codestyle.xml/ControlStatementBraces"/> |
74 | | - <rule ref="category/java/codestyle.xml/EmptyControlStatement"/> |
75 | | - <rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract"/> |
76 | | - <rule ref="category/java/codestyle.xml/ExtendsObject"/> |
77 | | - <rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass"/> |
78 | | - <rule ref="category/java/codestyle.xml/FieldNamingConventions"/> |
79 | | - <rule ref="category/java/codestyle.xml/FinalParameterInAbstractMethod"/> |
80 | | - <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop"/> |
81 | | - <rule ref="category/java/codestyle.xml/FormalParameterNamingConventions"/> |
82 | | - <rule ref="category/java/codestyle.xml/GenericsNaming"/> |
83 | | - <rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/> |
84 | | - <rule ref="category/java/codestyle.xml/LambdaCanBeMethodReference"/> |
85 | | - <rule ref="category/java/codestyle.xml/LinguisticNaming"/> |
86 | | - <rule ref="category/java/codestyle.xml/LocalHomeNamingConvention"/> |
87 | | - <rule ref="category/java/codestyle.xml/LocalInterfaceSessionNamingConvention"/> |
88 | | - <rule ref="category/java/codestyle.xml/LocalVariableNamingConventions"/> |
| 24 | + <rule ref="category/java/codestyle.xml"> |
| 25 | + <exclude name="AtLeastOneConstructor"/> |
| 26 | + <exclude name="CallSuperInConstructor"/> |
| 27 | + <exclude name="CommentDefaultAccessModifier"/> |
| 28 | + <exclude name="LocalVariableCouldBeFinal"/> |
| 29 | + <exclude name="LongVariable"/> <!--customized below--> |
| 30 | + <exclude name="MethodArgumentCouldBeFinal"/> |
| 31 | + <exclude name="MethodNamingConventions"/> <!--customized below--> |
| 32 | + <exclude name="OnlyOneReturn"/> |
| 33 | + <exclude name="ShortClassName"/> |
| 34 | + <exclude name="ShortMethodName"/> <!--customized below--> |
| 35 | + </rule> |
89 | 36 | <rule ref="category/java/codestyle.xml/LongVariable"> |
90 | 37 | <properties> |
91 | 38 | <property name="minimum" value="25"/> |
|
96 | 43 | <property name="junit5TestPattern" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$"/> |
97 | 44 | </properties> |
98 | 45 | </rule> |
99 | | - <rule ref="category/java/codestyle.xml/NoPackage"/> |
100 | | - <rule ref="category/java/codestyle.xml/PackageCase"/> |
101 | | - <rule ref="category/java/codestyle.xml/PrematureDeclaration"/> |
102 | 46 | <rule ref="category/java/codestyle.xml/ShortMethodName"> |
103 | 47 | <properties> |
104 | 48 | <property name="minimum" value="2"/> |
105 | 49 | </properties> |
106 | 50 | </rule> |
107 | | - <rule ref="category/java/codestyle.xml/ShortVariable"/> |
108 | | - <rule ref="category/java/codestyle.xml/TooManyStaticImports"/> |
109 | | - <rule ref="category/java/codestyle.xml/UnnecessaryAnnotationValueElement"/> |
110 | | - <rule ref="category/java/codestyle.xml/UnnecessaryBoxing"/> |
111 | | - <rule ref="category/java/codestyle.xml/UnnecessaryCast"/> |
112 | | - <rule ref="category/java/codestyle.xml/UnnecessaryConstructor"/> |
113 | | - <rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName"/> |
114 | | - <rule ref="category/java/codestyle.xml/UnnecessaryImport"/> |
115 | | - <rule ref="category/java/codestyle.xml/UnnecessaryLocalBeforeReturn"/> |
116 | | - <rule ref="category/java/codestyle.xml/UnnecessaryModifier"/> |
117 | | - <rule ref="category/java/codestyle.xml/UnnecessaryReturn"/> |
118 | | - <rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/> |
119 | | - <rule ref="category/java/codestyle.xml/UseDiamondOperator"/> |
120 | | - <rule ref="category/java/codestyle.xml/UseExplicitTypes"/> |
121 | | - <rule ref="category/java/codestyle.xml/UselessParentheses"/> |
122 | | - <rule ref="category/java/codestyle.xml/UselessQualifiedThis"/> |
123 | | - <rule ref="category/java/codestyle.xml/UseShortArrayInitializer"/> |
124 | | - <rule ref="category/java/codestyle.xml/UseUnderscoresInNumericLiterals"/> |
125 | 51 | <!-- Code Style --> |
126 | 52 |
|
127 | 53 | <!-- Design --> |
128 | | - <rule ref="category/java/design.xml/AbstractClassWithoutAnyMethod"/> |
129 | | - <rule ref="category/java/design.xml/AvoidCatchingGenericException"/> |
130 | | - <rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts"/> |
131 | | - <rule ref="category/java/design.xml/AvoidRethrowingException"/> |
132 | | - <rule ref="category/java/design.xml/AvoidThrowingNewInstanceOfSameException"/> |
133 | | - <rule ref="category/java/design.xml/AvoidThrowingNullPointerException"/> |
134 | | - <rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes"/> |
135 | | - <rule ref="category/java/design.xml/AvoidUncheckedExceptionsInSignatures"/> |
136 | | - <rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"/> |
137 | | - <rule ref="category/java/design.xml/CognitiveComplexity"/> |
138 | | - <rule ref="category/java/design.xml/CollapsibleIfStatements"/> |
139 | | - <rule ref="category/java/design.xml/CouplingBetweenObjects"/> |
140 | | - <rule ref="category/java/design.xml/CyclomaticComplexity"/> |
141 | | - <rule ref="category/java/design.xml/DataClass"/> |
142 | | - <rule ref="category/java/design.xml/DoNotExtendJavaLangError"/> |
143 | | - <rule ref="category/java/design.xml/ExceptionAsFlowControl"/> |
144 | | - <rule ref="category/java/design.xml/ExcessiveImports"/> |
145 | | - <rule ref="category/java/design.xml/ExcessiveParameterList"/> |
146 | | - <rule ref="category/java/design.xml/ExcessivePublicCount"/> |
147 | | - <rule ref="category/java/design.xml/FinalFieldCouldBeStatic"/> |
148 | | - <rule ref="category/java/design.xml/GodClass"/> |
149 | | - <rule ref="category/java/design.xml/ImmutableField"/> |
150 | | - <rule ref="category/java/design.xml/InvalidJavaBean"/> |
151 | | - <rule ref="category/java/design.xml/LawOfDemeter"/> |
152 | | - <rule ref="category/java/design.xml/LogicInversion"/> |
153 | | - <rule ref="category/java/design.xml/MutableStaticState"/> |
154 | | - <rule ref="category/java/design.xml/NcssCount"/> |
155 | | - <rule ref="category/java/design.xml/NPathComplexity"/> |
156 | | - <rule ref="category/java/design.xml/SignatureDeclareThrowsException"/> |
157 | | - <rule ref="category/java/design.xml/SimplifiedTernary"/> |
158 | | - <rule ref="category/java/design.xml/SimplifyBooleanExpressions"/> |
159 | | - <rule ref="category/java/design.xml/SimplifyBooleanReturns"/> |
160 | | - <rule ref="category/java/design.xml/SimplifyConditional"/> |
161 | | - <rule ref="category/java/design.xml/SingularField"/> |
162 | | - <rule ref="category/java/design.xml/SwitchDensity"/> |
163 | | - <rule ref="category/java/design.xml/TooManyFields"/> |
| 54 | + <rule ref="category/java/design.xml"> |
| 55 | + <exclude name="LoosePackageCoupling"/> |
| 56 | + <exclude name="TooManyMethods"/> <!--customized below--> |
| 57 | + <exclude name="UseUtilityClass"/> |
| 58 | + </rule> |
164 | 59 | <rule ref="category/java/design.xml/TooManyMethods"> |
165 | 60 | <properties> |
166 | 61 | <property name="maxmethods" value="15"/> |
167 | 62 | </properties> |
168 | 63 | </rule> |
169 | | - <rule ref="category/java/design.xml/UselessOverridingMethod"/> |
170 | | - <rule ref="category/java/design.xml/UseObjectForClearerAPI"/> |
171 | 64 | <!-- Design --> |
172 | 65 |
|
| 66 | + <!-- Error Prone --> |
173 | 67 | <rule ref="category/java/errorprone.xml"> |
| 68 | + <exclude name="AssignmentInOperand"/> <!--customized below--> |
174 | 69 | <exclude name="AvoidFieldNameMatchingMethodName"/> |
175 | 70 | </rule> |
| 71 | + <rule ref="category/java/errorprone.xml/AssignmentInOperand"> |
| 72 | + <properties> |
| 73 | + <property name="allowIncrementDecrement" value="true"/> |
| 74 | + </properties> |
| 75 | + </rule> |
| 76 | + <!-- Error Prone --> |
176 | 77 | <rule ref="category/java/multithreading.xml"/> |
177 | 78 | <rule ref="category/java/performance.xml"/> |
178 | 79 | <rule ref="category/java/security.xml"/> |
|
0 commit comments