-
Notifications
You must be signed in to change notification settings - Fork 11
/
pmd.xml
101 lines (88 loc) · 3.78 KB
/
pmd.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
<?xml version="1.0"?>
<ruleset name="Custom 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"
xsi:noNamespaceSchemaLocation="http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>MOTECH PMD ruleset</description>
<rule ref="rulesets/java/sunsecure.xml/MethodReturnsInternalArray">
<priority>2</priority>
</rule>
<rule ref="rulesets/java/sunsecure.xml/ArrayIsStoredDirectly">
<priority>2</priority>
</rule>
<rule ref="rulesets/java/codesize.xml/NcssMethodCount">
<properties>
<property name="minimum" value="50"/>
</properties>
</rule>
<rule ref="rulesets/java/coupling.xml/LooseCoupling"/>
<rule ref="rulesets/java/design.xml/ConstructorCallsOverridableMethod"/>
<rule ref="rulesets/java/design.xml/PreserveStackTrace"/>
<rule ref="rulesets/java/design.xml/SimplifyConditional"/>
<rule ref="rulesets/java/design.xml/UnnecessaryLocalBeforeReturn"/>
<rule ref="rulesets/java/logging-java.xml/AvoidPrintStackTrace"/>
<rule ref="rulesets/java/migrating.xml/IntegerInstantiation"/>
<rule ref="rulesets/java/strictexception.xml/AvoidCatchingThrowable"/>
<rule ref="rulesets/java/strictexception.xml/AvoidThrowingRawExceptionTypes"/>
<rule ref="rulesets/java/strictexception.xml/SignatureDeclareThrowsException"/>
<rule ref="rulesets/java/strings.xml/AvoidDuplicateLiterals"/>
<rule ref="rulesets/java/strings.xml/UseIndexOfChar"/>
<rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter"/>
<rule ref="rulesets/java/unusedcode.xml/UnusedLocalVariable"/>
<rule ref="rulesets/java/unusedcode.xml/UnusedPrivateField"/>
<rule ref="rulesets/java/unusedcode.xml/UnusedPrivateMethod"/>
<rule ref="rulesets/java/javabeans.xml/MissingSerialVersionUID"/>
<rule name="DontImportInternal"
language="java"
message="Avoid importing internal packages of any external libraries"
class="net.sourceforge.pmd.lang.rule.XPathRule">
<description>
Avoid importing any internal package of any external libraries.
</description>
<properties>
<property name="xpath">
<value>
<![CDATA[
//ImportDeclaration
[not(starts-with(Name/@Image, 'org.motechproject'))]
[contains(Name/@Image, '.internal.')]
]]>
</value>
</property>
</properties>
<priority>3</priority>
</rule>
<rule name="CommentedOutCode"
language="java"
message="Avoid commeneted out code."
class="CommentedOutCode">
<properties>
<property name="classificationThreshold" value="0.85"/>
<property name="skipCheckSequence" value="cmt"/>
<property name="skipJavaDocs" value="true"/>
</properties>
<description>
Don't you dare commit commented out code!
</description>
<priority>3</priority>
</rule>
<rule name="DontImportFasterxml" language="java"
message="Avoid importing com.fasterxml packages"
class="net.sourceforge.pmd.lang.rule.XPathRule">>
<description>
Avoid importing com.fasterxml packages.
</description>
<properties>
<property name="xpath">
<value>
<![CDATA[
//ImportDeclaration
[starts-with(Name/@Image, 'com.fasterxml')]
]]>
</value>
</property>
</properties>
<priority>3</priority>
</rule>
</ruleset>