Repository navigation
Expand file tree
/
Copy pathpmd-ruleset.xml
More file actions
68 lines (57 loc) · 2.34 KB
/
Copy pathpmd-ruleset.xml
File metadata and controls
68 lines (57 loc) · 2.34 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="OParl Java Client PMD RuleSet"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>OParl Java Client PMD RuleSet</description>
<rule ref="category/java/bestpractices.xml">
<!-- assertions without message and several assertions per test are fine -->
<exclude name="UnitTestAssertionsShouldIncludeMessage"/>
<exclude name="UnitTestContainsTooManyAsserts"/>
</rule>
<rule ref="category/java/design.xml">
<exclude name="LawOfDemeter"/>
<!-- needs a list of packages to check, so PMD removes it otherwise -->
<exclude name="LoosePackageCoupling"/>
<!-- the OParl objects map the properties of the specification -->
<exclude name="DataClass"/>
<exclude name="TooManyFields"/>
<exclude name="ExcessivePublicCount"/>
</rule>
<rule ref="category/java/errorprone.xml"/>
<rule ref="category/java/performance.xml"/>
<rule ref="category/java/security.xml"/>
<rule ref="category/java/multithreading.xml">
<!-- J2EE rule; the tests run a mock server -->
<exclude name="DoNotUseThreads"/>
</rule>
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
<properties>
<property name="allowCommentedBlocks" value="true"/>
</properties>
</rule>
<rule ref="category/java/design.xml/SignatureDeclareThrowsException">
<properties>
<property name="violationSuppressXPath"
value="./ancestor-or-self::ClassDeclaration[matches(@SimpleName, '^.*Test$')]"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/AvoidFieldNameMatchingMethodName">
<properties>
<property name="violationSuppressXPath"
value="./ancestor-or-self::ClassDeclaration[matches(@SimpleName, '^.*(Builder|Test)$')]"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals">
<properties>
<property name="violationSuppressXPath"
value="./ancestor-or-self::ClassDeclaration[matches(@SimpleName, '^.*Test$')]"/>
</properties>
</rule>
<rule ref="category/java/design.xml/TooManyMethods">
<properties>
<property name="violationSuppressXPath"
value="./ancestor-or-self::ClassDeclaration[matches(@SimpleName, '^(.*Test|MockOparlServer)$')]"/>
</properties>
</rule>
</ruleset>