Skip to content

Add or improve existing PMD rules

David Renz edited this page May 31, 2016 · 34 revisions

PMD is a Maven project and composed of different modules. Beside some general modules like the pmd-core module, there are modules for every supported language, for example pmd-apex. This modules vary in complexity. Some of them just offer a simple Copy/Paste Detector (CPD), like pmd-perl. Others provide complete language-specific static code analysis tools. This tools are parsing source code into abstract syntax trees (AST) and allow to apply rules to them.

If you want to add rules that work similarly to the ones we already have you will have to extend PMD itself. Those are the steps you need to do:

  1. Setup development environment

  2. Add a new rule for Apex PMD

  3. Build PMD and test your new rule

  4. Commit and Pull Request the new rule

Clone this wiki locally