-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpmd.xml
More file actions
145 lines (126 loc) · 5.66 KB
/
pmd.xml
File metadata and controls
145 lines (126 loc) · 5.66 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?xml version="1.0"?>
<ruleset name="PCGF_PluginLib 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 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
PCGF_PluginLib PMD Configuration
Enforces:
- Code quality standards
- Best practices
- Performance considerations
- Security checks
Note: Package structure conventions are enforced via Checkstyle.
</description>
<!-- Exclude generated NMS code from analysis -->
<exclude-pattern>.*/pcgf_pluginlib-platform-nms-(?!reflection)/.*</exclude-pattern>
<exclude-pattern>.*/freemarker/.*</exclude-pattern>
<exclude-pattern>.*/target/generated-sources/.*</exclude-pattern>
<!-- ============================================== -->
<!-- BEST PRACTICES -->
<!-- ============================================== -->
<rule ref="category/java/bestpractices.xml">
<exclude name="GuardLogStatement"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="SystemPrintln"/>
</rule>
<!-- ============================================== -->
<!-- CODE STYLE -->
<!-- ============================================== -->
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="CallSuperInConstructor"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="ConfusingTernary"/>
<exclude name="DefaultPackage"/>
<exclude name="LongVariable"/>
<exclude name="OnlyOneReturn"/>
<exclude name="ShortClassName"/>
<exclude name="ShortMethodName"/>
<exclude name="ShortVariable"/>
<exclude name="TooManyStaticImports"/>
</rule>
<!-- LongVariable - allow up to 40 chars (project uses descriptive names) -->
<rule ref="category/java/codestyle.xml/LongVariable">
<properties>
<property name="minimum" value="40"/>
</properties>
</rule>
<!-- ShortVariable - allow 2 chars for common patterns (id, db, etc.) -->
<rule ref="category/java/codestyle.xml/ShortVariable">
<properties>
<property name="minimum" value="2"/>
</properties>
</rule>
<!-- ============================================== -->
<!-- DESIGN -->
<!-- ============================================== -->
<rule ref="category/java/design.xml">
<exclude name="AvoidCatchingGenericException"/>
<exclude name="CouplingBetweenObjects"/>
<exclude name="DataClass"/>
<exclude name="ExcessiveImports"/>
<exclude name="LawOfDemeter"/>
<exclude name="LoosePackageCoupling"/>
<exclude name="TooManyFields"/>
<exclude name="TooManyMethods"/>
</rule>
<!-- Cognitive complexity - allow up to 25 (some methods are inherently complex) -->
<rule ref="category/java/design.xml/CognitiveComplexity">
<properties>
<property name="reportLevel" value="25"/>
</properties>
</rule>
<!-- Cyclomatic complexity - allow up to 15 -->
<rule ref="category/java/design.xml/CyclomaticComplexity">
<properties>
<property name="classReportLevel" value="80"/>
<property name="methodReportLevel" value="15"/>
</properties>
</rule>
<!-- NPath complexity -->
<rule ref="category/java/design.xml/NPathComplexity">
<properties>
<property name="reportLevel" value="200"/>
</properties>
</rule>
<!-- ============================================== -->
<!-- DOCUMENTATION -->
<!-- ============================================== -->
<rule ref="category/java/documentation.xml">
<exclude name="CommentRequired"/>
<exclude name="CommentSize"/>
</rule>
<!-- ============================================== -->
<!-- ERROR PRONE -->
<!-- ============================================== -->
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidDuplicateLiterals"/>
<exclude name="AvoidFieldNameMatchingMethodName"/>
<exclude name="AvoidFieldNameMatchingTypeName"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="MissingSerialVersionUID"/>
<exclude name="NullAssignment"/>
</rule>
<!-- Avoid duplicate literals - use default settings, rely on exclusions for SQL/keys -->
<!-- ============================================== -->
<!-- MULTITHREADING -->
<!-- ============================================== -->
<rule ref="category/java/multithreading.xml">
<exclude name="DoNotUseThreads"/>
<exclude name="UseConcurrentHashMap"/>
</rule>
<!-- ============================================== -->
<!-- PERFORMANCE -->
<!-- ============================================== -->
<rule ref="category/java/performance.xml">
<exclude name="AvoidInstantiatingObjectsInLoops"/>
</rule>
<!-- ============================================== -->
<!-- SECURITY -->
<!-- ============================================== -->
<rule ref="category/java/security.xml"/>
</ruleset>