Ranides Atterwim пре 10 година
родитељ
комит
57940d2cc4

+ 1 - 2
assira.common/pom.xml

@@ -102,8 +102,7 @@
                 <version>3.5</version>
                 <configuration>
                     <rulesets>
-                        <ruleset>rulesets/java/assira.custom.xml</ruleset>
-                        <ruleset>rulesets/java/assira.standard.xml</ruleset>
+                        <ruleset>rulesets/java/assira.xml</ruleset>
                     </rulesets>
                 </configuration>
                 <dependencies>

+ 7 - 2
assira.rules.test/pom.xml

@@ -20,7 +20,7 @@
                 <version>3.5</version>
                 <configuration>
                     <rulesets>
-                        <ruleset>rulesets/java/ranides.test.xml</ruleset>
+                        <ruleset>rulesets/java/assira.test.xml</ruleset>
                     </rulesets>
                 </configuration>
                 <dependencies>
@@ -33,5 +33,10 @@
             </plugin>
         </plugins>
     </build>
-	
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>annotations</artifactId>
+        </dependency>
+    </dependencies>
 </project>

+ 47 - 0
assira.rules.test/src/main/java/net/ranides/assira/rules/test/CustomRules1.java

@@ -0,0 +1,47 @@
+/*
+ *  @author Ranides Atterwim <ranides@gmail.com>
+ *  @copyright Ranides Atterwim
+ *  @license WTFPL
+ *  @url http://ranides.net/projects/assira.test
+ */
+package net.ranides.assira.rules.test;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * RULE: TEST-ECB (import from standard empty.xml/EmptyCatchBlock)
+ * RULE: TEST-UF (our first custom class)
+ * 
+ * RULE: TEST-UP (assira.custom.xml/UnusedParameter)
+ * 
+ * @author Ranides Atterwim <ranides@gmail.com>
+ */
+@SuppressFBWarnings
+public class CustomRules1 { // Expected: TEST-UF
+    
+    public void first() {
+        try {
+            if (true);
+
+            if (true) {
+            }
+
+            System.out.println("Hello world");
+        } catch (RuntimeException ex) { // Expected: TEST-ECB
+            
+        }
+    }
+    
+    
+    private void runme(
+        int hello, 
+        Object $world, 
+        int _x, 
+        int variable, // Expected: TEST-UP for "variable"
+        int a
+    ) {
+        // do nothing
+        int v = hello + a;
+    }
+
+}

+ 0 - 58
assira.rules.test/src/main/java/net/ranides/assira/rules/test/ECB.java

@@ -1,58 +0,0 @@
-/*
- *  @author Ranides Atterwim <ranides@gmail.com>
- *  @copyright Ranides Atterwim
- *  @license WTFPL
- *  @url http://ranides.net/projects/assira.test
- */
-package net.ranides.assira.rules.test;
-
-public class ECB {
-    
-    int a1;
-    int a2;
-    int a3;
-    int a4;
-    int a5;
-    int a6;
-    int a7;
-    int a8;
-    int a9;
-    int a10;
-    int a11;
-    int a12;
-    int a13;
-    int a14;
-    int a15;
-    int a16;
-    int a17;
-    int a18;
-    int a19;
-    int a20;
-    int a21;
-    int a22;
-    int a23;
-    int a24;
-    int a25;
-    int a26;
-    int a27;
-    int a28;
-    int a29;
-    
-    public static void main(String[] args) {
-        try {
-            if (true);
-
-            if (true) {
-            }
-
-            System.out.println("Hello world");
-        } catch (RuntimeException ex) {
-
-        }
-    }
-    
-    private void runme(int hello, Object $world) {
-        return;
-    }
-
-}

+ 34 - 30
assira.rules/pom.xml

@@ -1,31 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>net.ranides</groupId>
-        <artifactId>assira.common</artifactId>
-        <version>2.0.1</version>
-    </parent>
-    
-    <groupId>net.ranides</groupId>
-    <artifactId>assira.rules</artifactId>
-    <version>2.0.1</version>
-    <packaging>jar</packaging>
-    
-    <url>http://ranides.net/projects/assira</url>
-
-    <repositories>
-        <repository>
-            <id>ranides.net</id>
-            <name>ranides.net</name>
-            <url>http://maven.ranides.net</url>
-        </repository>
-    </repositories>
-
-    <dependencies>
-        <dependency>
-            <groupId>net.sourceforge.pmd</groupId>
-            <artifactId>pmd-java</artifactId>
-        </dependency>
-    </dependencies>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>net.ranides</groupId>
+        <artifactId>assira.common</artifactId>
+        <version>2.0.1</version>
+    </parent>
+    
+    <groupId>net.ranides</groupId>
+    <artifactId>assira.rules</artifactId>
+    <version>2.0.1</version>
+    <packaging>jar</packaging>
+    
+    <url>http://ranides.net/projects/assira</url>
+
+    <repositories>
+        <repository>
+            <id>ranides.net</id>
+            <name>ranides.net</name>
+            <url>http://maven.ranides.net</url>
+        </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>net.sourceforge.pmd</groupId>
+            <artifactId>pmd-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>annotations</artifactId>
+        </dependency>
+    </dependencies>
 </project>

+ 3 - 7
assira.rules/src/main/java/net/ranides/assira/rules/TestECB.java

@@ -9,19 +9,15 @@ package net.ranides.assira.rules;
 import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration;
 import net.sourceforge.pmd.lang.java.ast.JavaNode;
 import net.sourceforge.pmd.lang.java.rule.AbstractStatisticalJavaRule;
-import net.sourceforge.pmd.lang.rule.properties.DoubleProperty;
 import net.sourceforge.pmd.stat.DataPoint;
 
-public class TestECB extends AbstractStatisticalJavaRule {
-    
-     DoubleProperty MINIMUM_DESCRIPTOR = new DoubleProperty("minimum", "Minimum reporting threshold", 0d, 100d, null, 2.0f);
+public class UFRule extends AbstractStatisticalJavaRule {
 
     private final Class<?> nodeClass;
 
-    public TestECB() {
+    public UFRule() {
         super();
         this.nodeClass = ASTClassOrInterfaceDeclaration.class;
-        setProperty(MINIMUM_DESCRIPTOR, 20d);
     }
 
     @Override
@@ -30,7 +26,7 @@ public class TestECB extends AbstractStatisticalJavaRule {
             final DataPoint point = new DataPoint();
             point.setNode(node);
             point.setScore(1.0 * (node.getEndLine() - node.getBeginLine()));
-            point.setMessage(getMessage()+ " (V5)");
+            point.setMessage(getMessage() + " (V6)");
             addDataPoint(point);
         }
 

+ 30 - 52
assira.rules/src/main/java/net/ranides/assira/rules/UnusedParameterRule.java

@@ -7,16 +7,11 @@ import java.io.InvalidObjectException;
 import java.io.ObjectInputStream;
 import java.util.List;
 import java.util.Map;
+import net.ranides.assira.rules.utils.ASTUtils;
 
 import net.sourceforge.pmd.lang.ast.Node;
-import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration;
 import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration;
-import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter;
 import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
-import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclarator;
-import net.sourceforge.pmd.lang.java.ast.ASTName;
-import net.sourceforge.pmd.lang.java.ast.ASTNameList;
-import net.sourceforge.pmd.lang.java.ast.ASTType;
 import net.sourceforge.pmd.lang.java.ast.JavaNode;
 import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule;
 import net.sourceforge.pmd.lang.java.symboltable.JavaNameOccurrence;
@@ -24,20 +19,24 @@ import net.sourceforge.pmd.lang.java.symboltable.VariableNameDeclaration;
 import net.sourceforge.pmd.lang.rule.properties.BooleanProperty;
 import net.sourceforge.pmd.lang.symboltable.NameOccurrence;
 
+@SuppressWarnings("OverridableMethodCallInConstructor")
 public class UnusedParameterRule extends AbstractJavaRule {
 
-    private static final BooleanProperty CHECKALL_DESCRIPTOR = new BooleanProperty("checkAll",
-            "Check all methods, including non-private ones", false, 1.0f);
+    private static final BooleanProperty CHECKALL_DESCRIPTOR = new BooleanProperty(
+        "checkAll", "Check all methods, including non-private ones", false, 1.0f
+    );
 
     public UnusedParameterRule() {
         definePropertyDescriptor(CHECKALL_DESCRIPTOR);
     }
 
+    @Override
     public Object visit(ASTConstructorDeclaration node, Object data) {
         check(node, data);
         return data;
     }
 
+    @Override
     public Object visit(ASTMethodDeclaration node, Object data) {
         if (!node.isPrivate() && !getProperty(CHECKALL_DESCRIPTOR)) {
             return data;
@@ -49,64 +48,43 @@ public class UnusedParameterRule extends AbstractJavaRule {
     }
 
     private boolean isSerializationMethod(ASTMethodDeclaration node) {
-        ASTMethodDeclarator declarator = node.getFirstDescendantOfType(ASTMethodDeclarator.class);
-        List<ASTFormalParameter> parameters = declarator.findDescendantsOfType(ASTFormalParameter.class);
-        if (node.isPrivate()
-            && "readObject".equals(node.getMethodName())
-            && parameters.size() == 1
-            && throwsOneException(node, InvalidObjectException.class)) {
-            ASTType type = parameters.get(0).getTypeNode();
-            if (type.getType() == ObjectInputStream.class
-                    || ObjectInputStream.class.getSimpleName().equals(type.getTypeImage())
-                    || ObjectInputStream.class.getName().equals(type.getTypeImage())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private boolean throwsOneException(ASTMethodDeclaration node, Class<? extends Throwable> exception) {
-        ASTNameList throwsList = node.getThrows();
-        if (throwsList != null && throwsList.jjtGetNumChildren() == 1) {
-            ASTName n = (ASTName)throwsList.jjtGetChild(0);
-            if (n.getType() == exception
-                || exception.getSimpleName().equals(n.getImage())
-                || exception.getName().equals(n.getImage())) {
-                return true;
-            }
-        }
-        return false;
+        return node.isPrivate() 
+            && ASTUtils.isMethod(node, "readObject", ObjectInputStream.class)
+            && ASTUtils.throwsOne(node, InvalidObjectException.class);
     }
 
     private void check(Node node, Object data) {
         Node parent = node.jjtGetParent().jjtGetParent().jjtGetParent();
-        if (parent instanceof ASTClassOrInterfaceDeclaration
-                && !((ASTClassOrInterfaceDeclaration) parent).isInterface()) {
-            Map<VariableNameDeclaration, List<NameOccurrence>> vars = ((JavaNode) node).getScope().getDeclarations(
-                    VariableNameDeclaration.class);
-            for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) {
-                VariableNameDeclaration nameDecl = entry.getKey();
-                if (actuallyUsed(nameDecl, entry.getValue())) {
-                    continue;
-                }
-                if( nameDecl.getImage().startsWith("$")) {
-                    continue;
-                }
-                addViolation(data, nameDecl.getNode(), new Object[] {
-                        node instanceof ASTMethodDeclaration ? "method" : "constructor", nameDecl.getImage() });
+        if (!ASTUtils.isTypeClass(parent)) {
+            return;
+        }
+
+        Map<VariableNameDeclaration, List<NameOccurrence>> vars = 
+                ((JavaNode)node).getScope().getDeclarations(VariableNameDeclaration.class);
+        
+        for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) {
+            VariableNameDeclaration name = entry.getKey();
+            if( name.getImage().startsWith("$") || name.getImage().startsWith("_")) {
+                continue;
+            }
+            if (isActuallyUsed(name, entry.getValue())) {
+                continue;
             }
+            addViolation(data, name.getNode(), new Object[] {
+                node instanceof ASTMethodDeclaration ? "method" : "constructor", 
+                name.getImage() 
+            });
         }
     }
 
-    private boolean actuallyUsed(VariableNameDeclaration nameDecl, List<NameOccurrence> usages) {
+    private boolean isActuallyUsed(VariableNameDeclaration name, List<NameOccurrence> usages) {
         for (NameOccurrence occ : usages) {
             JavaNameOccurrence jocc = (JavaNameOccurrence) occ;
             if (jocc.isOnLeftHandSide()) {
-                if (nameDecl.isArray() && jocc.getLocation().jjtGetParent().jjtGetParent().jjtGetNumChildren() > 1) {
+                if (name.isArray() && jocc.getLocation().jjtGetParent().jjtGetParent().jjtGetNumChildren() > 1) {
                     // array element access
                     return true;
                 }
-                continue;
             } else {
                 return true;
             }

+ 80 - 0
assira.rules/src/main/java/net/ranides/assira/rules/utils/ASTUtils.java

@@ -0,0 +1,80 @@
+/*
+ * @author Ranides Atterwim <ranides@gmail.com>
+ * @copyright Ranides Atterwim
+ * @license WTFPL
+ * @url http://ranides.net/projects/assira.rules
+ */
+package net.ranides.assira.rules.utils;
+
+import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
+import java.util.List;
+import net.sourceforge.pmd.lang.ast.Node;
+import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration;
+import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter;
+import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
+import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclarator;
+import net.sourceforge.pmd.lang.java.ast.ASTName;
+import net.sourceforge.pmd.lang.java.ast.ASTNameList;
+import net.sourceforge.pmd.lang.java.ast.ASTType;
+
+/**
+ *
+ * @author Ranides Atterwim <ranides@gmail.com>
+ */
+public final class ASTUtils {
+    
+    private ASTUtils() {
+        /* utility class */
+    }
+    
+    public static boolean isType(ASTType type, Class<?> clazz) {
+        return type.getType() == clazz 
+            || clazz.getSimpleName().equals(type.getTypeImage())
+            || clazz.getName().equals(type.getTypeImage());
+    }
+    
+    public static boolean isType(ASTName type, Class<?> clazz) {
+        return type.getType() == clazz 
+            || clazz.getSimpleName().equals(type.getImage())
+            || clazz.getName().equals(type.getImage());
+    }
+    
+    public static boolean isTypeClass(Node type) {
+        return 
+            (type instanceof ASTClassOrInterfaceDeclaration)
+            && !((ASTClassOrInterfaceDeclaration) type).isInterface();
+    }
+    
+    public static boolean isMethod(ASTMethodDeclaration method, String name, Class... params) {
+        if( !name.equals(method.getMethodName()) ) {
+            return false;
+        }
+        
+        List<ASTFormalParameter> iparams = getParams(method);
+        if(iparams.size() != params.length) {
+            return false;
+        }
+        for(int i=0; i<params.length; i++) {
+            ASTType type = iparams.get(i).getTypeNode();
+            if( !ASTUtils.isType(type, params[i]) ) {
+                return false;
+            }
+        }
+        return true;
+    }
+    
+    public static boolean throwsOne(ASTMethodDeclaration method, Class<? extends Throwable> exception) {
+        ASTNameList throwsList = method.getThrows();
+        if (throwsList != null && throwsList.jjtGetNumChildren() == 1) {
+            ASTName node = (ASTName)throwsList.jjtGetChild(0);
+            return isType(node, exception);
+        }
+        return false;
+    }
+    
+    public static List<ASTFormalParameter> getParams(ASTMethodDeclaration method) {
+        ASTMethodDeclarator declarator = method.getFirstDescendantOfType(ASTMethodDeclarator.class);
+        return declarator.findDescendantsOfType(ASTFormalParameter.class);
+    }
+}

+ 9 - 9
assira.rules/src/main/resources/rulesets/java/assira.custom.xml

@@ -21,7 +21,7 @@
         <description><![CDATA[Counts unique methods (all overloaded versions are considered as the same). Ignores UtilityClassess.]]></description>
         <priority>3</priority>
         <properties>
-            <property name="maxmethods" type="Integer" description="The method count reporting threshold " min="1" max="1000" value="15"/>
+            <property name="maximum" type="Integer" description="The method count reporting threshold " min="1" max="1000" value="15"/>
             <property name="xpath"><value>
             <![CDATA[
             //ClassOrInterfaceDeclaration[
@@ -36,7 +36,7 @@
                         =
                         preceding-sibling::ClassOrInterfaceBodyDeclaration/MethodDeclaration/@MethodName
                         )
-                ]) > $maxmethods
+                ]) > $maximum
             
                 and not (
                     @Final='true'
@@ -63,7 +63,7 @@
         <description><![CDATA[Counts public methods]]></description>
         <priority>3</priority>
         <properties>
-            <property name="maxmethods" type="Integer" description="The method count reporting threshold " min="1" max="1000" value="40"/>
+            <property name="maximum" type="Integer" description="The method count reporting threshold " min="1" max="1000" value="40"/>
             <property name="xpath"><value>
             <![CDATA[
             //ClassOrInterfaceDeclaration[
@@ -72,7 +72,7 @@
                     and not(starts-with(@MethodName,'get'))
                     and not(starts-with(@MethodName,'set'))
                     and not(../Annotation/MarkerAnnotation/Name[@Image='Override'])
-                ]) > $maxmethods
+                ]) > $maximum
             ]
             ]]>
             </value></property>
@@ -139,7 +139,7 @@
     </rule>
 
 
-    <rule name="VarNameRules" since="2.0" class="net.sourceforge.pmd.lang.rule.XPathRule"
+    <rule name="FieldNameRules" since="2.0" class="net.sourceforge.pmd.lang.rule.XPathRule"
         message="Field name doesn't respect required pattern"
         externalInfoUrl="http://java.ranides.net/docs/pmd.htm#VariableNamingRegexp"
         language="java"
@@ -213,7 +213,7 @@
         <description>Long parameter lists can indicate that a new object should be created to wrap the numerous parameters.  Basically, try to group the parameters together.</description>
         <priority>3</priority>
         <properties>
-            <property name="maximum" type="Integer" description="The parameter count reporting threshold" min="1" max="1000" value="6"/>
+            <property name="maximum" type="Integer" description="The parameter count reporting threshold" min="1" max="1000" value="3"/>
             <property name="xpath"><value>
             <![CDATA[
             //ClassOrInterfaceBodyDeclaration
@@ -304,7 +304,7 @@
         <description><![CDATA[Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information.  For example, a class with city/state/zip fields could instead have one Address field.]]></description>
         <priority>3</priority>
         <properties>
-            <property name="maxfields" type="Integer" description="The field count reporting threshold " min="1" max="1000" value="15"/>
+            <property name="maximum" type="Integer" description="The field count reporting threshold " min="1" max="1000" value="15"/>
             <property name="xpath"><value>
             <![CDATA[
             //ClassOrInterfaceDeclaration[
@@ -312,14 +312,13 @@
                     ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/FieldDeclaration
                     [@Final='false']
                     [@Static='false']
-                ) > $maxfields
+                ) > $maximum
             ]
             ]]>
             </value></property>
         </properties>
     </rule>
 
-    <!--  Ignores parameters prefixed with $ :) -->    
     <rule name="UnusedParameter"
               language="java"
               since="5.3"
@@ -328,6 +327,7 @@
               externalInfoUrl="${pmd.website.baseurl}/rules/java/unusedcode.html#UnusedFormalParameter">
         <description>
             Avoid passing parameters to methods or constructors without actually referencing them in the method body.
+            Note: that rule ignores parameters prefixed with $ or _.
         </description>
         <priority>3</priority>
         <example>

+ 34 - 0
assira.rules/src/main/resources/rulesets/java/assira.test.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<ruleset name="net.ranides.assira.standard"
+         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"
+         xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+
+    <description>TEST</description>
+
+    <rule
+        name="TEST-ECB"
+        ref="rulesets/java/empty.xml/EmptyCatchBlock"
+        message="TEST: Must handle exceptions">
+        <priority>2</priority>
+    </rule>
+        
+    <rule name="TEST-UF"
+              language="java"
+              since="2.0.1"
+              message="TEST-UF: message"
+              class="net.ranides.assira.rules.UFRule"
+              externalInfoUrl="..."
+    >
+        <description>TEST-UF: description</description>
+        <priority>3</priority>
+        <properties>
+            <property name="allowCommentedBlocks" type="Boolean" value="false" description="text" />
+        </properties>
+    </rule>
+        
+    <rule name="TEST-UP" ref="rulesets/java/assira.custom.xml/UnusedParameter"/>
+
+</ruleset>

+ 28 - 0
assira.rules/src/main/resources/rulesets/java/assira.standard.xml

@@ -264,5 +264,33 @@
     <rule ref="rulesets/java/unnecessary.xml/UnnecessaryFinalModifier"/>
     <rule ref="rulesets/java/unnecessary.xml/UselessOperationOnImmutable"/>
     <rule ref="rulesets/java/unnecessary.xml/UnusedNullCheckInEquals"/>
+    
+    <rule ref="rulesets/java/assira.custom.xml/TooManyDifferentMethods">
+        <properties>
+            <property name="maximum" value="15"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/assira.custom.xml/TooManyPublicMethods">
+        <properties>
+            <property name="maximum" value="40"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/assira.custom.xml/LongVar"/>
+    <rule ref="rulesets/java/assira.custom.xml/FieldNameRules"/>
+    <rule ref="rulesets/java/assira.custom.xml/MethodNameRules"/>
+    <rule ref="rulesets/java/assira.custom.xml/InvalidUtilityClass"/>
+    <rule ref="rulesets/java/assira.custom.xml/TooManyParams">
+        <properties>
+            <property name="maximum" value="5"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/assira.custom.xml/AvoidThreadGroup"/>
+    <rule ref="rulesets/java/assira.custom.xml/UseSingleton"/>
+    <rule ref="rulesets/java/assira.custom.xml/TooManyFields">
+        <properties>
+            <property name="maximum" value="15"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/assira.custom.xml/UnusedParameter"/>
 
 </ruleset>

+ 0 - 55
assira.rules/src/main/resources/rulesets/java/ranides.test.xml

@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<ruleset name="net.ranides.assira.standard"
-         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"
-         xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
-
-    <description>TEST</description>
-
-    <rule
-        name="TST-ECB"
-        ref="rulesets/java/empty.xml/EmptyCatchBlock"
-        message="TEST: Must handle exceptions">
-        <priority>2</priority>
-    </rule>
-        
-    <rule name="TST-RES"
-              language="java"
-              since="0.1"
-              message="TEST: Big"
-              class="net.ranides.assira.rules.TestECB"
-              externalInfoUrl="${pmd.website.baseurl}/rules/java/empty.html#EmptyCatchBlock">
-        <description>
-            ecb22
-        </description>
-        <priority>3</priority>
-        <properties>
-            <property name="allowCommentedBlocks" type="Boolean" value="false" description="text" />
-        </properties>
-    </rule>
-        
-    <rule name="UnusedParameter"
-              language="java"
-              since="0.8"
-              message="Avoid unused {0} parameters such as ''{1}''."
-              class="net.ranides.assira.rules.UnusedParameterRule"
-              externalInfoUrl="${pmd.website.baseurl}/rules/java/unusedcode.html#UnusedFormalParameter">
-        <description>
-            Avoid passing parameters to methods or constructors without actually referencing them in the method body.
-        </description>
-        <priority>3</priority>
-
-        <example>
-<![CDATA[
-public class Foo {
-	private void bar(String howdy) {
-	// howdy is not used
-	}
-}
-]]>
-        </example>
-    </rule>
-
-</ruleset>