Files
maven-plugins/pmd/src/plugin-resources/rulesets/coupling.xml
T
2003-04-04 11:06:45 +00:00

72 lines
1.9 KiB
XML

<?xml version="1.0"?>
<ruleset name="coupling">
<description>
These are new rules for coupling
</description>
<rule name="CouplingBetweenObjectsRule"
message="High amount of different objects as memebers donotes a high coupling"
class="net.sourceforge.pmd.rules.CouplingBetweenObjectsRule">
<description>
Rule counts unique attributes, local variables and return types within an object. An amount
higher than specified threshold can indicate a high degree of couping with in an object
</description>
<priority>3</priority>
<properties>
<property name="threshold" value="20"/>
</properties>
<example>
<![CDATA[
import com.Blah;
import org.Bar;
import org.Bardo;
//
public class Foo {
private Blah var1;
private Bar var2;
//followed by many imports of unique objects
void ObjectC doWork() {
Bardo var55;
ObjectA var44;
ObjectZ var93;
return something;
}
}
]]>
</example>
</rule>
<rule name="ExcessiveImportsRule"
message="A high number of imports can indicate a high degree of coupling within an object."
class="net.sourceforge.pmd.rules.ExcessiveImportsRule">
<description>
A high number of imports can indicate a high degree of coupling within
an object. Rule counts the number of unique imports and reports a violation
if the count is above the user defined threshold.
</description>
<priority>3</priority>
<properties>
<property name="minimum" value="30"/>
</properties>
<example>
<![CDATA[
import blah.blah.Bardo;
import blah.blah.Hardo;
import blah.blah.Bar;
import blah.net.ObjectA;
//imports over some threshold
public class Foo {
public void doWork() {}
}
]]>
</example>
</rule>
</ruleset>