Updated PMD configuration to work with all the projects.

Former-commit-id: 80b9aac40019ef95d95ac5dcd3cb417290c37d7e
This commit is contained in:
Will Stranathan
2014-04-22 20:50:06 -04:00
parent f2b908c859
commit 6642c23761
7 changed files with 54 additions and 27 deletions

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ruleset name="DependencyCheck Rules"
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
http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<rule name="LoggerChaining"
message="Logger should be a field, don't chain it"
class="net.sourceforge.pmd.lang.rule.XPathRule"
language="java">
<description><![CDATA[
Loggers should be created as fields within the class for general
use, rather than chaining the call to getLogger() followed by
the work on the Logger.
]]></description>
<properties>
<property name="xpath">
<value><![CDATA[
//PrimaryPrefix[Name/@Image = 'Logger.getLogger' and count(following-sibling::PrimarySuffix) > 2]
]]></value>
</property>
</properties>
<example><![CDATA[
Logger.getLogger(Foo.class).log(Level.FINEST, "Don't do this");
]]></example>
</rule>
</ruleset>

View File

@@ -366,7 +366,7 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
<exclude>**/generated/*.java</exclude>
</excludes>
<rulesets>
<ruleset>dc-rules/dcrules.xml</ruleset>
<ruleset>../dc-rules/dcrules.xml</ruleset>
<ruleset>/rulesets/java/basic.xml</ruleset>
<ruleset>/rulesets/java/imports.xml</ruleset>
<ruleset>/rulesets/java/unusedcode.xml</ruleset>