Permalink
Browse files

introduce selected (more thorough) PMD rules

  • Loading branch information...
hoijui committed Jan 15, 2016
1 parent 6a4b0ba commit f374a8ce8477ec8c4b16dcf95ea0465353cf1246
Showing with 59 additions and 0 deletions.
  1. +3 −0 pom.xml
  2. +56 −0 src/main/resources/pmd.xml
View
@@ -92,6 +92,9 @@
<aggregate>true</aggregate>
<linkXref>true</linkXref>
<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
<rulesets>
<ruleset>src/main/resources/pmd.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
View
@@ -0,0 +1,56 @@
<?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="PMD-rules"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>PMD rules selection for otr4j</description>
<rule ref="rulesets/java/basic.xml"/>
<rule ref="rulesets/java/braces.xml">
<exclude name="IfStmtsMustUseBraces"/>
<exclude name="IfElseStmtsMustUseBraces"/>
<exclude name="ForLoopsMustUseBraces"/>
</rule>
<rule ref="rulesets/java/clone.xml"/>
<!--<rule ref="rulesets/java/codesize.xml"/>-->
<!--<rule ref="rulesets/java/comments.xml"/>-->
<rule ref="rulesets/java/controversial.xml">
<exclude name="AvoidFinalLocalVariable"/>
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="CallSuperInConstructor"/>
<exclude name="UseConcurrentHashMap"/>
<exclude name="OnlyOneReturn"/>
</rule>
<!--<rule ref="rulesets/java/coupling.xml"/>-->
<rule ref="rulesets/java/design.xml">
<exclude name="UseVarargs"/>
<exclude name="GodClass"/>
</rule>
<rule ref="rulesets/java/empty.xml"/>
<rule ref="rulesets/java/finalizers.xml"/>
<rule ref="rulesets/java/imports.xml"/>
<rule ref="rulesets/java/javabeans.xml">
<exclude name="BeanMembersShouldSerialize"/> <!-- NOTE We might want to use this one day -->
</rule>
<rule ref="rulesets/java/junit.xml"/>
<rule ref="rulesets/java/migrating_to_15.xml"/>
<rule ref="rulesets/java/naming.xml">
<exclude name="LongVariable"/>
<exclude name="ShortVariable"/>
<exclude name="ShortClassName"/>
</rule>
<rule ref="rulesets/java/optimizations.xml">
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="MethodArgumentCouldBeFinal"/>
</rule>
<rule ref="rulesets/java/strictexception.xml"/>
<rule ref="rulesets/java/strings.xml"/>
<rule ref="rulesets/java/sunsecure.xml"/>
<rule ref="rulesets/java/typeresolution.xml"/>
<rule ref="rulesets/java/unnecessary.xml">
<exclude name="UselessParentheses"/>
</rule>
<rule ref="rulesets/java/unusedcode.xml"/>
</ruleset>

0 comments on commit f374a8c

Please sign in to comment.