forked from jodconverter/jodconverter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruleset.xml
160 lines (152 loc) · 6.64 KB
/
ruleset.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
<?xml version="1.0"?>
<ruleset name="JODConverter ruleset" 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 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
This is the JODConverter Official PMD ruleset.
</description>
<!-- Use the 'bestpractices' category -->
<rule ref="category/java/bestpractices.xml">
<exclude name="AccessorClassGeneration"/>
<exclude name="AccessorMethodGeneration"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
</rule>
<rule ref="category/java/bestpractices.xml/JUnitTestContainsTooManyAsserts">
<properties>
<property name="maximumAsserts" value="10"/>
</properties>
</rule>
<rule ref="category/java/bestpractices.xml/GuardLogStatement">
<properties>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<!-- Use the 'code style' category -->
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="DefaultPackage"/>
<exclude name="LinguisticNaming"/>
<exclude name="OnlyOneReturn"/>
<exclude name="ShortVariable"/>
<exclude name="TooManyStaticImports"/>
</rule>
<rule ref="category/java/codestyle.xml/CommentDefaultAccessModifier">
<properties>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/LongVariable">
<properties>
<property name="minimum" value="35"/>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/MethodNamingConventions">
<properties>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ShortClassName">
<properties>
<property name="minimum" value="3"/>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ShortMethodName">
<properties>
<property name="minimum" value="2"/>
</properties>
</rule>
<!-- Use the 'design' category -->
<rule ref="category/java/design.xml">
<exclude name="AvoidCatchingGenericException"/>
<exclude name="AvoidThrowingRawExceptionTypes"/>
<exclude name="DataClass"/>
<exclude name="LawOfDemeter"/>
<exclude name="LoosePackageCoupling"/>
<exclude name="NcssCount"/>
<exclude name="SignatureDeclareThrowsException"/>
</rule>
<rule ref="category/java/design.xml/ExcessiveImports">
<properties>
<property name="minimum" value="50"/>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<rule ref="category/java/design.xml/ExcessiveMethodLength">
<properties>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<rule ref="category/java/design.xml/TooManyFields">
<properties>
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Properties')]"/>
</properties>
</rule>
<rule ref="category/java/design.xml/TooManyMethods">
<properties>
<property name="maxmethods" value="15"/>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<rule ref="category/java/design.xml/UseUtilityClass">
<properties>
<property name="ignoredAnnotations" value="org.springframework.boot.autoconfigure.SpringBootApplication"/>
</properties>
</rule>
<!-- Use the 'documentation' category -->
<rule ref="category/java/documentation.xml">
<exclude name="CommentSize"/>
</rule>
<rule ref="category/java/documentation.xml/CommentRequired">
<properties>
<property name="fieldCommentRequirement" value="Ignored"/>
<property name="protectedMethodCommentRequirement" value="Ignored"/>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<!-- Use the 'errorprone' category -->
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidFieldNameMatchingMethodName"/>
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="DoNotTerminateVM"/>
<exclude name="NullAssignment"/>
</rule>
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals">
<properties>
<!-- Ignore the rule for test classes -->
<property name="violationSuppressXPath"
value="./ancestor::ClassOrInterfaceDeclaration[matches(@Image, '^.*Test')]"/>
</properties>
</rule>
<!-- Use the 'multithreading' category -->
<rule ref="category/java/multithreading.xml">
<exclude name="DoNotUseThreads"/>
<exclude name="UseConcurrentHashMap"/>
</rule>
<!-- Use the 'performance' category -->
<rule ref="category/java/performance.xml">
<exclude name="AvoidInstantiatingObjectsInLoops"/>
</rule>
</ruleset>