-
Notifications
You must be signed in to change notification settings - Fork 59
/
pmd-java-configuration.xml
113 lines (111 loc) · 4.77 KB
/
pmd-java-configuration.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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ${project.groupId}:${project.artifactId}:${project.version} -->
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="pmd-eclipse"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>Ullrich Hafner's PMD rules</description>
<rule ref="category/java/bestpractices.xml">
<exclude name="AccessorMethodGeneration"/>
<exclude name="LooseCoupling"/>
<exclude name="GuardLogStatement"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="JUnit5TestShouldBePackagePrivate"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="LiteralsFirstInComparisons"/>
<exclude name="UnusedPrivateMethod"/>
</rule>
<rule ref="category/java/bestpractices.xml/LooseCoupling">
<properties>
<property name="allowedTypes" value="java.util.Properties, java.util.Stack, java.util.jar.Attributes, net.minidev.json.JSONArray, hudson.util.ListBoxModel, hudson.util.ComboBoxModel, hudson.DescriptorExtensionList, hudson.EnvVars, org.jsoup.select.Elements, edu.hm.hafner.util.LineRangeList" />
</properties>
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="ClassNamingConventions"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="ConfusingTernary"/>
<exclude name="EmptyControlStatement"/>
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="LocalVariableNamingConventions"/>
<exclude name="LongVariable"/>
<exclude name="OnlyOneReturn"/>
<exclude name="ShortClassName"/>
<exclude name="ShortVariable"/>
<exclude name="UnnecessaryConstructor"/>
<exclude name="UseExplicitTypes"/>
</rule>
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
<properties>
<property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]+"/>
<property name="testClassPattern" value="^[A-Z][a-zA-Z0-9]+Test.*$|^[A-Z][a-zA-Z0-9]+Benchmark.*$|"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ConfusingTernary">
<properties>
<property name="ignoreElseIf" value="true"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/LinguisticNaming">
<properties>
<property name="checkSetters" value="false"/>
<property name="booleanMethodPrefixes" value="is|has|can|have|will" />
</properties>
</rule>
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor">
<properties>
<property name="ignoredAnnotations" value="org.kohsuke.stapler.DataBoundConstructor"/>
</properties>
</rule>
<rule ref="category/java/design.xml">
<exclude name="AvoidCatchingGenericException"/>
<exclude name="AvoidUncheckedExceptionsInSignatures"/>
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
<exclude name="ExcessiveImports"/>
<exclude name="ExcessiveParameterList"/>
<exclude name="FinalFieldCouldBeStatic"/>
<exclude name="LawOfDemeter"/>
<exclude name="LoosePackageCoupling"/>
<exclude name="SimplifyBooleanReturns"/>
<exclude name="TooManyMethods"/>
<exclude name="UseObjectForClearerAPI"/>
</rule>
<rule ref="category/java/design.xml/SimplifyBooleanReturns">
<properties>
<property name="violationSuppressXPath" value="./ancestor::*[@Name = 'equals'] | ./ancestor::*[@Name = 'hashCode']"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidDuplicateLiterals"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="EmptyCatchBlock"/>
<exclude name="TestClassWithoutTestCases"/>
<exclude name="UseProperClassLoader"/>
</rule>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
<properties>
<property name="ignoreMagicNumbers" value="-1,0,1"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
<properties>
<property name="allowCommentedBlocks" value="true"/>
</properties>
</rule>
<rule ref="category/java/multithreading.xml">
<exclude name="UseConcurrentHashMap"/>
</rule>
<rule ref="category/java/performance.xml">
<exclude name="AppendCharacterWithChar"/>
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<exclude name="ConsecutiveAppendsShouldReuse"/>
<exclude name="RedundantFieldInitializer"/>
<exclude name="UseStringBufferForStringAppends"/>
</rule>
<rule ref="category/java/security.xml">
</rule>
</ruleset>