This article needs additional citations for verification. (August 2015)
|Initial release||4 November 2002|
6.55.0 / 25 February 2023
7.0.0-rc1 / 25 March 2023
|Operating system||Windows, Linux, macOS|
|Type||Static program analysis tool|
|License||BSD License, Apache License 2.0, GNU Lesser General Public License|
While PMD does not officially stand for anything, several retro acronyms have been suggested, including for instance Programming Mistake Detector and Project Meets Deadline.
PMD is able to detect flaws or possible flaws in source code, like:
- 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.
PMD is released under a BSDish license while parts of it are under Apache License 2.0 and the LGPL.
Copy/Paste Detector (CPD)
The Copy/Paste Detector (CPD) is an add-on to PMD that uses the Rabin–Karp string search algorithm to find duplicated code. Unlike PMD, CPD works with a broader range of languages including Java, JavaServer Pages (JSP), C, C++, Fortran, PHP, and C# code.
PMD has plugins for JDeveloper, Eclipse, jEdit, JBuilder, Omnicore's CodeGuide, NetBeans/Sun Studio, IntelliJ IDEA, TextPad, Maven, Ant, Gradle, Gel, JCreator, Hudson, Jenkins, SonarQube, Visual Studio Code and Emacs. There is also a CLI version.
- ^ "PMD 6.55.0 (25-February-2023)". Retrieved 31 March 2023.
- ^ "PMD 7.0.0-rc1 (25-March-2023)". Retrieved 31 March 2023.
- ^ a b "License". GitHub. 18 January 2015. Retrieved 13 August 2015.
- ^ "What does 'PMD' mean?". pmd-code.org. Retrieved 31 March 2023.
- ^ "Destroy annoying bugs part 4: the end is near". freesoftwaremagazine.com.
- ^ "Tools / Integrations". pmd-code.org. Retrieved 31 March 2023.
- 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
- Official website
- PMD on GitHub
- PMD on SourceForge
- CPD on SourceForge.net.
- Book: "PMD Applied" Written by the lead developer, Tom Copeland ().
- PMD and CPD in Maven