[Jpeergen-cvs] dev/rulesets jpeergen-strict.xml,NONE,1.1 jpeergen.xml,NONE,1.1
Status: Beta
Brought to you by:
pspeed
|
From: <ps...@us...> - 2004-08-12 07:52:15
|
Update of /cvsroot/jpeergen/dev/rulesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17098/rulesets Added Files: jpeergen-strict.xml jpeergen.xml Log Message: Checking in initial build environment. --- NEW FILE: jpeergen-strict.xml --- <?xml version="1.0"?> <ruleset name="meta-jb"> <description> The tweaked compliance tests for meta-jb code. </description> <!-- Here's some rules we'll specify one at a time --> <rule ref="rulesets/basic.xml" /> <rule ref="rulesets/imports.xml" /> <rule ref="rulesets/unusedcode.xml" /> <rule ref="rulesets/strings.xml" /> <rule ref="rulesets/braces.xml"> <exclude name="WhileLoopsMustUseBracesRule" /> <exclude name="IfStmtsMustUseBraces" /> </rule> <rule ref="rulesets/codesize.xml" /> <rule ref="rulesets/design.xml" > <exclude name="AvoidReassigningParametersRule" /> </rule> </ruleset> --- NEW FILE: jpeergen.xml --- <?xml version="1.0"?> <ruleset name="meta-jb"> <description> The tweaked compliance tests for meta-jb code. </description> <!-- Here's some rules we'll specify one at a time --> <rule ref="rulesets/basic.xml" /> <rule ref="rulesets/imports.xml" /> <rule ref="rulesets/unusedcode.xml" /> <rule ref="rulesets/strings.xml" /> <rule ref="rulesets/naming.xml/ShortMethodNameRule" /> <rule ref="rulesets/braces.xml"> <exclude name="WhileLoopsMustUseBracesRule" /> <exclude name="IfStmtsMustUseBraces" /> <exclude name="IfElseStmtsMustUseBracesRule" /> </rule> <rule ref="rulesets/codesize.xml" > </rule> <rule ref="rulesets/design.xml" > <exclude name="AvoidReassigningParametersRule" /> <exclude name="ConstructorCallsOverridableMethodRule" /> <exclude name="AvoidDeeplyNestedIfStmts" /> </rule> <rule ref="rulesets/controversial.xml/NullAssignment"/> <!-- Some real rules, most clipped from the standard rulesets to tweak the parameters. --> <rule name="AvoidDeeplyNestedIfStmts" message="Deeply nested if..then statements are hard to read" class="net.sourceforge.pmd.rules.AvoidDeeplyNestedIfStmtsRule"> <description> Deeply nested if..then statements are hard to read. </description> <priority>3</priority> <properties> <property name="problemDepth" value="4"/> </properties> <example> <![CDATA[ public class Foo { public void bar() { int x=2; int y=3; int z=4; if (x>y) { if (y>z) { if (z==x) { // this is officially out of control now } } } } } ]]> </example> </rule> <rule name="LongVariable" message="Avoid excessively long variable names" class="net.sourceforge.pmd.rules.XPathRule"> <description> Detects when a field, formal or local variable is declared with a big name. </description> <priority>3</priority> <properties> <property name="xpath"> <value> <![CDATA[ //FieldDeclaration[@Final='false' or @Static='false' or @Public='false' ] /VariableDeclarator/VariableDeclaratorId[string-length(@Image) > 20] ]]> </value> </property> </properties> <example> <![CDATA[ public class Something { int reallyLongIntName = -3; // VIOLATION - Field public static void main( String argumentsList[] ) { // VIOLATION - Formal int otherReallyLongName = -5; // VIOLATION - Local for (int interestingIntIndex = 0; // VIOLATION - For interestingIntIndex < 10; interestingIntIndex ++ ) { } } ]]> </example> </rule> </ruleset> |