-
Notifications
You must be signed in to change notification settings - Fork 206
/
pmd-ruleset.xml
54 lines (54 loc) · 2.31 KB
/
pmd-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
<?xml version="1.0"?>
<ruleset name="Fabric Chaincode Java rules"
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 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>Custom PMD ruleset</description>
<rule ref="category/java/bestpractices.xml">
<exclude name="UseVarargs"/>
</rule>
<rule ref="category/java/bestpractices.xml/LooseCoupling">
<properties>
<property name="allowedTypes" value="java.util.Properties,org.hyperledger.fabric.contract.metadata.TypeSchema"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="LongVariable"/>
<exclude name="OnlyOneReturn"/>
<exclude name="ShortVariable"/>
<exclude name="TooManyStaticImports"/>
</rule>
<rule ref="category/java/codestyle.xml/UseExplicitTypes">
<properties>
<property name="allowLiterals" value="true"/>
<property name="allowCtors" value="true"/>
</properties>
</rule>
<rule ref="category/java/design.xml">
<exclude name="CouplingBetweenObjects"/>
<exclude name="DataClass"/>
<exclude name="ExcessiveImports"/>
<exclude name="LoosePackageCoupling"/>
<exclude name="TooManyMethods"/>
</rule>
<rule ref="category/java/design.xml/LawOfDemeter">
<properties>
<property name="trustRadius" value="3"/>
</properties>
</rule>
<rule ref="category/java/documentation.xml/UncommentedEmptyConstructor"/>
<rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody"/>
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidFieldNameMatchingMethodName"/>
<exclude name="UseProperClassLoader"/>
</rule>
<rule ref="category/java/multithreading.xml">
<exclude name="DoNotUseThreads"/>
<exclude name="UseConcurrentHashMap"/>
</rule>
<rule ref="category/java/performance.xml"/>
<rule ref="category/java/security.xml"/>
</ruleset>