sonar-checkstyle icon indicating copy to clipboard operation
sonar-checkstyle copied to clipboard

Upgrade PMD

Open rnveach opened this issue 7 years ago • 2 comments

Upgrade PMD to the latest version to fix issues with https://github.com/checkstyle/sonar-checkstyle/issues/160

Should be almost a copy of main repo.

rnveach avatar Sep 26 '18 22:09 rnveach

The update causes the following violations (no suppressions):

[INFO] --- maven-pmd-plugin:3.10.0:check (default) @ checkstyle-sonar-plugin ---
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:43 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:45 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:46 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:47 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:48 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:50 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:112 Rule:AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:120 Rule:AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:135 Rule:AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block.
[INFO] PMD Failure: o.s.p.c.CheckstyleAuditListener:153 Rule:AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:49 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:50 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:52 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:54 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:55 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:56 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:57 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:59 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:67 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:69 Rule:AvoidFileStream Priority:1 Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:84 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:96 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:104 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConfiguration:137 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:22 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:22 Rule:ClassNamingConventions Priority:1 The utility class name 'CheckstyleConstants' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper)'.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:24 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:25 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:26 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:27 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:29 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:30 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:32 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:35 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleConstants:38 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:47 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:48 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:51 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:53 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:54 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:55 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:57 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleExecutor:108 Rule:AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block.
[INFO] PMD Failure: o.s.p.c.CheckstylePlugin:31 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstylePlugin:33 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstylePlugin:35 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstylePlugin:36 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstylePlugin:43 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstylePlugin:50 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporter:41 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporter:41 Rule:TooManyMethods This class has too many methods, consider refactoring it..
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporter:43 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporter:47 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporter:49 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporter:51 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:46 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:48 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:50 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:51 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:52 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:53 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:60 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:62 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter:207 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter$Module:208 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter$Module:209 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporter$Module:210 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleRulesDefinition:33 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSensor:32 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSensor:34 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSensor:35 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSensor:36 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSensor:38 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSeverityUtils:28 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSeverityUtils:30 Rule:CommentRequired Field comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSeverityUtils:36 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSeverityUtils:58 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleSeverityUtils:78 Rule:AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block.
[INFO] PMD Failure: o.s.p.c.CheckstyleVersion:28 Rule:CommentRequired Header comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleVersion:30 Rule:CommentRequired Public method and constructor comments are required.
[INFO] PMD Failure: o.s.p.c.CheckstyleVersion:43 Rule:AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporterTest:52 Rule:JUnitTestsShouldIncludeAssert JUnit tests should include assert() or fail().
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporterTest:65 Rule:JUnitTestsShouldIncludeAssert JUnit tests should include assert() or fail().
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporterTest:80 Rule:JUnitTestsShouldIncludeAssert JUnit tests should include assert() or fail().
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporterTest:109 Rule:JUnitTestsShouldIncludeAssert JUnit tests should include assert() or fail().
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporterTest:132 Rule:JUnitTestsShouldIncludeAssert JUnit tests should include assert() or fail().
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporterTest:154 Rule:JUnitTestsShouldIncludeAssert JUnit tests should include assert() or fail().
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileExporterTest:175 Rule:JUnitTestsShouldIncludeAssert JUnit tests should include assert() or fail().
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporterTest:74 Rule:JUnitAssertionsShouldIncludeMessage JUnit assertions should include a message.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporterTest:76 Rule:JUnitAssertionsShouldIncludeMessage JUnit assertions should include a message.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporterTest:139 Rule:JUnitAssertionsShouldIncludeMessage JUnit assertions should include a message.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporterTest:150 Rule:JUnitAssertionsShouldIncludeMessage JUnit assertions should include a message.
[INFO] PMD Failure: o.s.p.c.CheckstyleProfileImporterTest:172 Rule:JUnitAssertionsShouldIncludeMessage JUnit assertions should include a message.
[INFO] PMD Failure: o.s.p.c.CheckstyleRulesDefinitionTest:48 Rule:JUnitTestContainsTooManyAsserts JUnit tests should not contain more than 11 assert(s)..
[INFO] PMD Failure: o.s.p.c.internal.ChecksTest:267 Rule:AvoidFileStream Priority:1 Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter.
[INFO] PMD Failure: o.s.p.c.internal.ChecksTest:274 Rule:CyclomaticComplexity The method 'validateSonarProperties(Map, Set)' has a cyclomatic complexity of 14..
[INFO] PMD Failure: o.s.p.c.internal.ChecksTest:372 Rule:CyclomaticComplexity The method 'getFinalProperties(Class)' has a cyclomatic complexity of 16..

rnveach avatar Sep 27 '18 01:09 rnveach

This issue is not complete. Suppressions were added to speed up fixing TC.

https://github.com/checkstyle/sonar-checkstyle/blob/master/checkstyle-sonar-plugin/config/pmd-main.xml#L12 https://github.com/checkstyle/sonar-checkstyle/blob/master/checkstyle-sonar-plugin/config/pmd-test.xml#L54

rnveach avatar Oct 04 '18 14:10 rnveach