forked from TEAMMATES/teammates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteammates-pmd.xml
95 lines (76 loc) · 3.44 KB
/
teammates-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
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name=""
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
This is the PMD ruleset for all TEAMMATES Java code.
</description>
<rule ref="rulesets/java/basic.xml"/>
<rule ref="rulesets/java/design.xml">
<!-- Thread-safety-related rule -->
<exclude name="AvoidSynchronizedAtMethodLevel"/>
<exclude name="NonThreadSafeSingleton"/>
<!-- Very difficult to enforce -->
<exclude name="GodClass"/>
<exclude name="ImmutableField"/>
<!-- Not worth the added safety -->
<exclude name="ConstructorCallsOverridableMethod"/>
<exclude name="SimpleDateFormatNeedsLocale"/>
<exclude name="UseLocaleWithCaseConversions"/>
<exclude name="UseVarargs"/>
</rule>
<rule ref="rulesets/java/empty.xml">
<!-- Prefer Checkstyle's which allows commented empty block -->
<exclude name="EmptyIfStmt"/>
<exclude name="EmptyCatchBlock"/>
</rule>
<rule ref="rulesets/java/junit.xml">
<!-- Not worth the benefit -->
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="JUnitStaticSuite"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
</rule>
<rule ref="rulesets/java/optimizations.xml">
<!-- Inevitably occur -->
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<!-- Not worth the optimization -->
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="SimplifyStartsWith"/>
<!-- Achieved by disallowing parameter reassignment -->
<exclude name="MethodArgumentCouldBeFinal"/>
</rule>
<rule ref="rulesets/java/strictexception.xml">
<!-- Some are needed as safety net -->
<exclude name="AvoidCatchingGenericException"/>
<exclude name="AvoidThrowingRawExceptionTypes"/>
<!-- Might be enforced later on -->
<exclude name="SignatureDeclareThrowsException"/>
</rule>
<rule ref="rulesets/java/strings.xml">
<!-- Very difficult to enforce -->
<exclude name="AvoidDuplicateLiterals"/>
</rule>
<rule ref="rulesets/java/unnecessary.xml"/>
<rule ref="rulesets/java/unusedcode.xml"/>
<!-- Not used, but kept here for reference and possible change in the future -->
<!-- Relevant only for production code -->
<!--<rule ref="rulesets/java/logging-java.xml"/>-->
<!-- Not worth the trouble in enforcing -->
<!--<rule ref="rulesets/java/codesize.xml"/>-->
<!--<rule ref="rulesets/java/comments.xml"/>-->
<!--<rule ref="rulesets/java/controversial.xml"/>-->
<!--<rule ref="rulesets/java/coupling.xml"/>-->
<!--<rule ref="rulesets/java/sunsecure.xml"/>-->
<!-- Handled by Checkstyle -->
<!--<rule ref="rulesets/java/braces.xml"/>-->
<!--<rule ref="rulesets/java/imports.xml"/>-->
<!--<rule ref="rulesets/java/naming.xml"/>-->
<!-- Irrelevant for our code -->
<!--<rule ref="rulesets/java/clone.xml"/>-->
<!--<rule ref="rulesets/java/finalizers.xml"/>-->
<!--<rule ref="rulesets/java/j2ee.xml"/>-->
<!--<rule ref="rulesets/java/javabeans.xml"/>-->
<!--<rule ref="rulesets/java/logging-jakarta-commons.xml"/>-->
<!--<rule ref="rulesets/java/migrating.xml"/>-->
</ruleset>