• R/O
  • HTTP
  • SSH
  • HTTPS

Jovsonz: Commit

Jovsonz is a JSON library for Java


Commit MetaInfo

Revision04776da2c48965f2fc9e491799b79f67ef215114 (tree)
Zeit2019-05-03 14:03:23
AutorOlyutorskii <olyutorskii@user...>
CommiterOlyutorskii

Log Message

update pmd plugin.

Ändern Zusammenfassung

Diff

--- /dev/null
+++ b/config/pmd/pmdrules.xml
@@ -0,0 +1,82 @@
1+<?xml version="1.0" encoding="UTF-8" ?>
2+
3+<!--
4+ Custom rule set
5+ for PMD [ https://pmd.github.io/ ] 6.13.0 or later
6+
7+ Copyright(c) 2016 olyutorskii
8+-->
9+
10+<ruleset
11+ xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
12+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13+ xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
14+ http://pmd.sourceforge.net/ruleset_2_0_0.xsd"
15+ name="Custom ruleset"
16+>
17+
18+ <description>
19+ custom rulesets
20+ </description>
21+
22+ <rule ref="category/java/bestpractices.xml" />
23+
24+ <rule ref="category/java/codestyle.xml" >
25+ <exclude name="CommentDefaultAccessModifier" />
26+ <exclude name="DefaultPackage" />
27+ <exclude name="LocalVariableCouldBeFinal" />
28+ <exclude name="MethodArgumentCouldBeFinal" />
29+ <exclude name="OnlyOneReturn" />
30+ <exclude name="ShortVariable" />
31+ <exclude name="UnnecessaryLocalBeforeReturn" />
32+ <exclude name="UnnecessaryReturn" />
33+ </rule>
34+ <rule ref="category/java/codestyle.xml/ControlStatementBraces" >
35+ <properties>
36+ <property name="checkIfElseStmt" value="false"/>
37+ <property name="checkSingleIfStmt" value="false"/>
38+ </properties>
39+ </rule>
40+
41+ <rule ref="category/java/design.xml" >
42+ <exclude name="AvoidThrowingNullPointerException" />
43+ <exclude name="AvoidUncheckedExceptionsInSignatures" />
44+ <exclude name="LawOfDemeter" />
45+ <exclude name="LoosePackageCoupling" />
46+ <exclude name="SimplifyBooleanReturns" />
47+ </rule>
48+
49+ <rule ref="category/java/documentation.xml" />
50+ <rule ref="category/java/documentation.xml/CommentRequired" >
51+ <properties>
52+ <property name="fieldCommentRequirement" value="Ignored"/>
53+ </properties>
54+ </rule>
55+ <rule ref="category/java/documentation.xml/CommentSize" >
56+ <properties>
57+ <property name="maxLines" value="25"/>
58+ </properties>
59+ </rule>
60+
61+ <rule ref="category/java/errorprone.xml" >
62+ <exclude name="AvoidLiteralsInIfCondition" />
63+ <exclude name="BeanMembersShouldSerialize" />
64+ <exclude name="DataflowAnomalyAnalysis" />
65+ </rule>
66+
67+ <rule ref="category/java/multithreading.xml" />
68+
69+ <rule ref="category/java/performance.xml" >
70+ <exclude name="ConsecutiveAppendsShouldReuse" />
71+ <exclude name="RedundantFieldInitializer" />
72+ </rule>
73+
74+ <rule ref="category/java/security.xml" />
75+
76+ <!--rule ref="category/pom/errorprone.xml" /-->
77+
78+ <!--rule ref="category/xml/errorprone.xml" /-->
79+
80+</ruleset>
81+
82+<!-- EOF -->
--- a/pom.xml
+++ b/pom.xml
@@ -102,6 +102,9 @@
102102 <checkstyle.config.location>${project.mainconf}/checks.xml</checkstyle.config.location>
103103 <checkstyle.enable.rss>false</checkstyle.enable.rss>
104104
105+ <pmd-plugin.version>3.12.0</pmd-plugin.version>
106+ <pmd.analysisCache>true</pmd.analysisCache>
107+
105108 <spotbugs-plugin.version>3.1.11</spotbugs-plugin.version>
106109 <spotbugs.effort>Max</spotbugs.effort>
107110 <spotbugs.threshold>Low</spotbugs.threshold>
@@ -346,11 +349,10 @@
346349 <plugin>
347350 <groupId>org.apache.maven.plugins</groupId>
348351 <artifactId>maven-pmd-plugin</artifactId>
349- <version>3.6</version>
352+ <version>${pmd-plugin.version}</version>
350353 <configuration>
351- <targetJdk>${maven.compiler.target}</targetJdk>
352354 <rulesets>
353- <ruleset>${project.mainconf}/pmdrules.xml</ruleset>
355+ <ruleset>${project.basedir}/config/pmd/pmdrules.xml</ruleset>
354356 </rulesets>
355357 </configuration>
356358 </plugin>
@@ -517,12 +519,10 @@
517519 <plugin>
518520 <groupId>org.apache.maven.plugins</groupId>
519521 <artifactId>maven-pmd-plugin</artifactId>
520- <version>3.6</version>
522+ <version>${pmd-plugin.version}</version>
521523 <configuration>
522- <skip>false</skip>
523- <targetJdk>${maven.compiler.target}</targetJdk>
524524 <rulesets>
525- <ruleset>${project.mainconf}/pmdrules.xml</ruleset>
525+ <ruleset>${project.basedir}/config/pmd/pmdrules.xml</ruleset>
526526 </rulesets>
527527 </configuration>
528528 <reportSets>
--- a/src/main/config/pmdrules.xml
+++ /dev/null
@@ -1,142 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8" ?>
2-
3-<!--
4- PMD用ルールセット定義
5-
6- PMD [ https://pmd.github.io/ ] 5.3 以降用に記述されています。
7-
8- Copyright(c) 2016 olyutorskii
9--->
10-
11-<ruleset
12- xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
13- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14- xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
15- http://pmd.sourceforge.net/ruleset_2_0_0.xsd"
16- name="Custom ruleset"
17->
18-
19- <description>
20- custom rulesets for project
21- </description>
22-
23-<!--
24- <rule ref="rulesets/java/android.xml" />
25--->
26-
27- <rule ref="rulesets/java/basic.xml" />
28-
29- <rule ref="rulesets/java/braces.xml">
30- <exclude name="IfElseStmtsMustUseBraces" />
31- <exclude name="IfStmtsMustUseBraces" />
32- </rule>
33-
34- <rule ref="rulesets/java/clone.xml" />
35-
36- <rule ref="rulesets/java/codesize.xml">
37- <exclude name="TooManyMethods" />
38- </rule>
39- <rule ref="rulesets/java/codesize.xml/TooManyMethods">
40- <properties>
41- <property name="maxmethods" value="25"/>
42- </properties>
43- </rule>
44-
45- <rule ref="rulesets/java/comments.xml">
46- <exclude name="CommentRequired" />
47- <exclude name="CommentSize" />
48- </rule>
49- <rule ref="rulesets/java/comments.xml/CommentRequired" >
50- <properties>
51- <property name="fieldCommentRequirement" value="Ignored"/>
52- </properties>
53- </rule>
54- <rule ref="rulesets/java/comments.xml/CommentSize" >
55- <properties>
56- <property name="maxLines" value="25"/>
57- </properties>
58- </rule>
59-
60- <rule ref="rulesets/java/controversial.xml">
61- <exclude name="NullAssignment" />
62- <exclude name="OnlyOneReturn" />
63- <exclude name="DefaultPackage" />
64- <exclude name="DataflowAnomalyAnalysis" />
65- <exclude name="AvoidUsingShortType" />
66- <exclude name="AvoidLiteralsInIfCondition" />
67- <exclude name="UseConcurrentHashMap" />
68- </rule>
69-
70- <rule ref="rulesets/java/coupling.xml">
71- <exclude name="LoosePackageCoupling" />
72- <exclude name="LawOfDemeter" />
73- </rule>
74-
75- <rule ref="rulesets/java/design.xml">
76- <exclude name="SimplifyBooleanReturns" />
77- <exclude name="ConfusingTernary" />
78- <exclude name="UnnecessaryLocalBeforeReturn" />
79- <exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
80- </rule>
81-
82- <rule ref="rulesets/java/empty.xml" />
83-
84- <rule ref="rulesets/java/finalizers.xml" />
85-
86- <rule ref="rulesets/java/imports.xml" />
87-
88-<!--
89- <rule ref="rulesets/java/j2ee.xml" />
90- <rule ref="rulesets/java/javabeans.xml" />
91--->
92-
93- <rule ref="rulesets/java/junit.xml" />
94-
95-<!--
96- <rule ref="rulesets/java/logging-jakarta-commons.xml" />
97--->
98-
99- <rule ref="rulesets/java/logging-java.xml" />
100-
101- <rule ref="rulesets/java/migrating.xml" />
102-<!--
103- <rule ref="rulesets/java/migrating_to_XX.xml" />
104--->
105-
106- <rule ref="rulesets/java/naming.xml">
107- <exclude name="ShortVariable" />
108- <exclude name="LongVariable" />
109- <exclude name="AvoidFieldNameMatchingMethodName" />
110- </rule>
111- <rule ref="rulesets/java/naming.xml/LongVariable">
112- <properties>
113- <property name="minimum" value="25"/>
114- </properties>
115- </rule>
116-
117- <rule ref="rulesets/java/optimizations.xml">
118- <exclude name="LocalVariableCouldBeFinal" />
119- <exclude name="MethodArgumentCouldBeFinal" />
120- <exclude name="RedundantFieldInitializer" />
121- </rule>
122-
123- <rule ref="rulesets/java/strictexception.xml">
124- <exclude name="AvoidThrowingNullPointerException" />
125- </rule>
126-
127- <rule ref="rulesets/java/strings.xml" />
128-
129- <rule ref="rulesets/java/sunsecure.xml" />
130-
131- <rule ref="rulesets/java/typeresolution.xml" />
132-
133- <rule ref="rulesets/java/unnecessary.xml">
134- <exclude name="UnnecessaryReturn" />
135- <exclude name="UselessParentheses" />
136- </rule>
137-
138- <rule ref="rulesets/java/unusedcode.xml" />
139-
140-</ruleset>
141-
142-<!-- EOF -->
Show on old repository browser