[Plexus-svn] SF.net SVN: plexus:[875] trunk/plexus-graph/src/main/config/pmd/ruleset.xml
Status: Alpha
Brought to you by:
rconner
|
From: <rc...@us...> - 2010-09-13 20:39:38
|
Revision: 875
http://plexus.svn.sourceforge.net/plexus/?rev=875&view=rev
Author: rconner
Date: 2010-09-13 20:39:32 +0000 (Mon, 13 Sep 2010)
Log Message:
-----------
customizing the PMD ruleset a bit
Modified Paths:
--------------
trunk/plexus-graph/src/main/config/pmd/ruleset.xml
Modified: trunk/plexus-graph/src/main/config/pmd/ruleset.xml
===================================================================
--- trunk/plexus-graph/src/main/config/pmd/ruleset.xml 2010-09-10 22:36:31 UTC (rev 874)
+++ trunk/plexus-graph/src/main/config/pmd/ruleset.xml 2010-09-13 20:39:32 UTC (rev 875)
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+
<ruleset name="Plexus Ruleset" xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
@@ -18,24 +19,139 @@
<rule ref="rulesets/basic.xml" />
<rule ref="rulesets/braces.xml" />
<rule ref="rulesets/clone.xml" />
- <rule ref="rulesets/codesize.xml" />
- <rule ref="rulesets/controversial.xml" />
<rule ref="rulesets/coupling.xml" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/finalizers.xml" />
<rule ref="rulesets/imports.xml" />
<rule ref="rulesets/j2ee.xml" />
- <rule ref="rulesets/javabeans.xml" />
- <rule ref="rulesets/junit.xml" />
<rule ref="rulesets/logging-jakarta-commons.xml" />
<rule ref="rulesets/logging-java.xml" />
- <rule ref="rulesets/migrating.xml" />
- <rule ref="rulesets/naming.xml" />
- <rule ref="rulesets/optimizations.xml" />
+ <rule ref="rulesets/migrating_to_13.xml" />
+ <rule ref="rulesets/migrating_to_14.xml" />
+ <rule ref="rulesets/migrating_to_15.xml" />
<rule ref="rulesets/strictexception.xml" />
<rule ref="rulesets/strings.xml" />
<rule ref="rulesets/sunsecure.xml" />
<rule ref="rulesets/typeresolution.xml" />
<rule ref="rulesets/unusedcode.xml" />
+ <!--
+ Exclude some rules that I have serious problems with, some
+ because I want to customize some properties (later in this
+ config), and some because I want to get the low-hangin fruit
+ first.
+ -->
+
+
+ <rule ref="rulesets/codesize.xml" >
+ <!-- Overriding. maxmethods property. -->
+ <exclude name="TooManyMethods" />
+ </rule>
+
+ <rule ref="rulesets/codesize.xml/TooManyMethods" >
+ <properties>
+ <!-- default is 10, not even enough for java.util.Collection -->
+ <property name="maxmethods" value="32" />
+ </properties>
+ </rule>
+
+
+ <rule ref="rulesets/controversial.xml">
+ <!--
+ Excluding. This rule says that having only the public no-arg
+ constructor is a bad thing if it doesn't do anything.
+ -->
+ <exclude name="UnnecessaryConstructor" />
+
+ <!--
+ Excluding. This rule says that a method should only have one
+ return statement and it should be the last statement.
+ -->
+ <exclude name="OnlyOneReturn" />
+
+ <!--
+ Excluding. This rule says that interface method declarations
+ shouldn't be public, or that classes or interfaces nested in an
+ interface shouldn't be declared public or static.
+ -->
+ <exclude name="UnusedModifier" />
+
+ <!--
+ Excluding. This rule says to never use package-private scoping.
+ -->
+ <exclude name="DefaultPackage" />
+
+ <!--
+ Excluding. "booleanValue ^= true" is just not clear. The
+ speed benefit is clearly not worth the maintenance cost for
+ this one, in my opinion.
+ -->
+ <exclude name="BooleanInversion" />
+
+ <!--
+ Excluding. Final local variables should not be fields (as
+ the rule docs state), for a few reasons. One, they might
+ actually have different values on different method calls.
+ Two, it's the only way to reference a local variable in an
+ anyonymous inner class.
+ -->
+ <exclude name="AvoidFinalLocalVariable" />
+
+ <!--
+ Excluding. Unfortunately, this rule does 3 things, one of
+ which is very bad.
+ -->
+ <exclude name="DataflowAnomalyAnalysis" />
+ </rule>
+
+
+ <rule ref="rulesets/javabeans.xml">
+ <!--
+ Excluding. This rule says that fields which are neither
+ transient or static must have accessor methods, which is
+ just nuts.
+ -->
+ <exclude name="BeanMembersShouldSerialize" />
+ </rule>
+
+
+ <rule ref="rulesets/junit.xml" >
+ <!-- FIXME: temporary -->
+ <exclude name="JUnitAssertionsShouldIncludeMessage" />
+ </rule>
+
+ <!-- FIXME: temporary
+ <rule ref="rulesets/migrating_to_junit4.xml" />
+ -->
+
+
+ <rule ref="rulesets/naming.xml" >
+ <!-- FIXME: temporary, maybe -->
+ <exclude name="ShortVariable" />
+
+ <!-- Overriding. minimum property. -->
+ <exclude name="LongVariable" />
+ </rule>
+
+ <rule ref="rulesets/naming.xml/LongVariable" >
+ <properties>
+ <!-- default is 17 -->
+ <property name="minimum" value="32" />
+ </properties>
+ </rule>
+
+
+ <rule ref="rulesets/optimizations.xml">
+ <!-- FIXME: temporary -->
+ <exclude name="LocalVariableCouldBeFinal" />
+ <!-- FIXME: temporary -->
+ <exclude name="MethodArgumentCouldBeFinal" />
+
+ <!--
+ Excluding. This hasn't been a problem in Java for a long
+ time.
+ -->
+ <exclude name="AvoidInstantiatingObjectsInLoops" />
+ </rule>
+
</ruleset>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|