From 0d65c2e6e6081f15c98addc9b54e61c9425572e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 19 Mar 2020 01:49:55 +0100 Subject: [PATCH] Add relevant property tag --- .../resources/category/apex/codestyle.xml | 5 ++ .../resources/category/apex/errorprone.xml | 6 ++ .../sourceforge/pmd/lang/rule/XPathRule.java | 4 +- .../net/sourceforge/pmd/xml/j2ee.xml | 9 +++ .../test/resources/rulesets/dummy/basic.xml | 4 +- .../resources/rulesets/ruledoctest/sample.xml | 3 + .../rulesets/ruledoctest/sample2.xml | 1 + .../resources/category/java/bestpractices.xml | 22 +++++++ .../resources/category/java/codestyle.xml | 32 ++++++++++ .../main/resources/category/java/design.xml | 18 ++++++ .../resources/category/java/documentation.xml | 4 +- .../resources/category/java/errorprone.xml | 58 +++++++++++++++++++ .../category/java/multithreading.xml | 7 +++ .../resources/category/java/performance.xml | 13 +++++ .../pmd/ant/classpathtest/ruleset.xml | 1 + .../category/ecmascript/bestpractices.xml | 4 ++ .../category/ecmascript/codestyle.xml | 9 +++ .../category/ecmascript/errorprone.xml | 3 + .../resources/category/jsp/bestpractices.xml | 4 ++ .../main/resources/category/jsp/design.xml | 3 + .../resources/category/jsp/errorprone.xml | 1 + .../main/resources/category/jsp/security.xml | 1 + .../category/plsql/bestpractices.xml | 1 + .../resources/category/plsql/codestyle.xml | 2 + .../main/resources/category/plsql/design.xml | 1 + .../resources/category/plsql/errorprone.xml | 3 + .../main/resources/rulesets/dummy/basic.xml | 3 +- .../src/main/resources/category/vm/design.xml | 1 + .../resources/category/pom/errorprone.xml | 2 + .../resources/category/xml/errorprone.xml | 1 + .../main/resources/category/xsl/codestyle.xml | 1 + .../resources/category/xsl/performance.xml | 1 + 32 files changed, 223 insertions(+), 5 deletions(-) diff --git a/pmd-apex/src/main/resources/category/apex/codestyle.xml b/pmd-apex/src/main/resources/category/apex/codestyle.xml index 72c22c83ce..e76d6ebb8a 100644 --- a/pmd-apex/src/main/resources/category/apex/codestyle.xml +++ b/pmd-apex/src/main/resources/category/apex/codestyle.xml @@ -45,6 +45,7 @@ from the rest. 3 + 3 + 3 + 1 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + tmp = new HashMap<>(); - tmp.put(XPATH_1_0, XPATH_2_0); - tmp.put(XPATH_1_0_COMPATIBILITY, XPATH_2_0); + tmp.put(XPATH_1_0, XPATH_1_0); + tmp.put(XPATH_1_0_COMPATIBILITY, XPATH_1_0_COMPATIBILITY); tmp.put(XPATH_2_0, XPATH_2_0); XPATH_VERSIONS = Collections.unmodifiableMap(tmp); } diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/xml/j2ee.xml b/pmd-core/src/test/resources/net/sourceforge/pmd/xml/j2ee.xml index 607967f6fd..17443c62ab 100644 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/xml/j2ee.xml +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/xml/j2ee.xml @@ -20,6 +20,7 @@ 3 + 4 + 4 + 4 + 4 + 4 + 3 + 3 + 3 + 3 + 3 + - \ No newline at end of file + diff --git a/pmd-doc/src/test/resources/rulesets/ruledoctest/sample.xml b/pmd-doc/src/test/resources/rulesets/ruledoctest/sample.xml index 44e2bb76fb..78591da860 100644 --- a/pmd-doc/src/test/resources/rulesets/ruledoctest/sample.xml +++ b/pmd-doc/src/test/resources/rulesets/ruledoctest/sample.xml @@ -57,6 +57,7 @@ Here might be <script>alert('XSS');</script> as well. And "quotes". 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + + //ForInit/LocalVariableDeclaration[count(VariableDeclarator) > $maximumVariables] @@ -587,6 +593,7 @@ through the @RunWith(Suite.class) annotation. 3 + 3 + 3 + 3 + 3 + 4 + 3 + 3 + 3 + 3 + //Type/ReferenceType/ClassOrInterfaceType[@Image='Hashtable'] @@ -1206,6 +1222,7 @@ Consider replacing Vector usages with the newer java.util.ArrayList if expensive 3 + //Type/ReferenceType/ClassOrInterfaceType[@Image='Vector'] @@ -1267,6 +1284,7 @@ will (and by priority) and avoid clogging the Standard out log. 2 + 3 + 3 + 3 + 3 + 3 + 3 + 4 + 3 + 2 + //Name[starts-with(@Image,'System.loadLibrary')] @@ -314,6 +319,7 @@ prefix for these methods. 4 + 3 + 3 + 1 + No need to explicitly extend Object. 4 + 3 + 3 + //ForStatement[not(Statement/Block)] @@ -861,6 +873,7 @@ Names for references to generic values should be limited to a single uppercase l 4 + 3 + 3 + 4 + 4 + 3 + 4 + 3 + 3 + //PackageDeclaration/Name[lower-case(@Image)!=@Image] @@ -1532,6 +1553,7 @@ Remote Interface of a Session EJB should not have a suffix. 4 + 4 + 4 + 3 + 3 + + 3 + stringsWithDiamond = new ArrayList<>(); // using the diamond operat Useless parentheses should be removed. 4 + 3 + 3 + 3 + //WhileStatement[not(Statement/Block)] diff --git a/pmd-java/src/main/resources/category/java/design.xml b/pmd-java/src/main/resources/category/java/design.xml index 4a3dfa92dc..04ac51af08 100644 --- a/pmd-java/src/main/resources/category/java/design.xml +++ b/pmd-java/src/main/resources/category/java/design.xml @@ -23,6 +23,7 @@ protected constructor in order to prevent instantiation than make the class misl 1 + 3 + 3 + 3 + 1 + 1 + 3 + 1 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 +