Activating more PMD rulesets

PMD has rules for capturing particular bugs. It bundles those rules into rulesets. For example, there is a ruleset with a theme about Android programming another for code size or design. By default, three non-controversial PMD rulesets are measured:

  • Basic: Obvious practices that every developer should follow, such as don't ignore the Exceptions that are caught
  • Unusedcoded: Finds code that is never used lines that can be eliminated, avoiding waste and aiding readability
  • Imports: Spots unnecessary imports

This recipe shows you how to enable more rules. The main risk is that the extra rules generate a lot of false positives, making it difficult to see real defects. The benefit is that you will capture a wider range of defects, ...

Get Jenkins Continuous Integration Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.