The PMD bundled plugin scans Java source code and other languages, and looks for potential problems such as bugs, dead code, suboptimal code, overcomplicated expressions, and duplicate code. Use the plugin in your code review process to find common programming flaws.
PMD is configurable and can find many different issues.
The PMD libraries are embedded in the plugin, so there are no external tools to install.
Because PMD operates on source code files, add the PMD plugin to a chain that populates a workspace.
When you add the PMD plugin step to a chain, specify the following configuration details:
|Title||Enter a name for the step. Default: PMD.|
Enter the relative stream directory against which to run the analysis, for example:
Command-line option (should be a relative path):
Select a ruleset location:
Enter a comma-separated list of ruleset names, for example:
In addition to standard rulesets, you can use a custom ruleset.
(Optional) Specify the classpath for libraries used by the source code, for example:
(Optional) Specify the source code encoding, for example, UTF-8.
(Optional) Specify the source code language, for example, Java.
(Optional) Specify the version of the source code language.
(Optional) Select to show suppressed findings.
(Optional) Specify the suppress marker, for example, NOPMDNEWMARKER.
The PMD command-line option shows how each configuration field maps to the PMD command-line tool.
Tip: The PMD plugin and PMD command-line tool use the PMD core library. Any options that you can pass to the PMD command-line tool you can also pass to the PMD plugin.