- Possible bugs—Empty try/catch/finally/switch blocks.
- Dead code—Unused local variables, parameters and private methods.
- Empty if/while statements.
- Overcomplicated expressions—Unnecessary if statements, for loops that could be while loops.
- Suboptimal code—Wasteful String/StringBuffer usage.
- Classes with high Cyclomatic Complexity measurements.
- Duplicate code—Copied/pasted code can mean copied/pasted bugs, and decreases maintainability.
While PMD does not officially stand for anything, it has several unofficial names, the most appropriate probably being Programming Mistake Detector.
Typically, PMD errors are not true errors, but rather inefficient code, i.e. the application could still function properly even if they were not corrected.
PMD includes a set of built-in rules and supports the ability to write custom rules. The custom rules can be written in two ways:
- Using XPath
- Using Java classes
Copy/Paste Detector (CPD)
- Rutar, Almazan, Foster (2004), "A Comparison of Bug Finding Tools for Java". ISSRE '04 Proceedings of the 15th International Symposium on Software Reliability Engineering, IEEE, DOI: 10.1109/ISSRE.2004.1
- Home page at SourceForge.net.
- CPD at SourceForge.net.
- Book: "PMD Applied". Written by the lead developer, Tom Copeland (http://tomcopeland.blogs.com/).
- Redsauce PMD Parser Small utility that parses PMD output in HTML syntax
- PMD and CPD in Maven
|This programming tool–related article is a stub. You can help Wikipedia by expanding it.|