PMD (software)
PMD
|
|
---|---|
Basic data
|
|
Maintainer | Andreas Dangel, Juan Martín Sotuyo Dodero, Clément Fournier |
Current version |
6.20.0 ( November 29, 2019 ) |
operating system | platform independent |
programming language | Java |
category | Programming tool |
License | BSD style |
pmd.github.io |
PMD is a programming tool for the static code analysis of source texts . In addition to Java , JavaScript , XML and XSL as well as dialects derived from them are supported. The name PMD itself has officially no written meaning.
Bug fixes
The bugs PMD finds are typically not real bugs but rather inefficient code; H. the software will usually still run correctly if the errors are not corrected. Based on static rules, PMD finds potential problems such as:
-
Possible bugs - empty
try/catch/finally/switch
blocks. - Dead Code - Unused Local Variables , Parameters, and Private Methods
- Empty
if/while
expressions -
Overcomplicated expressions - unnecessary
if
expressions, or loops that could be usedfor
as loops insteadwhile
-
Sub-optimal code - wasteful use of
String/StringBuffer
- Classes with high cyclomatic complexity .
PMD offers a multitude of built-in rules and the possibility to extend existing rules or to write your own rules.
Extensions and plug-ins
PMD provides plug-ins for development environments such as JDeveloper , Eclipse , JBuilder , NetBeans , JCreator and IntelliJ IDEA as well as editors such as JEdit , Emacs and TextPad . In addition, there are extensions for build tools such as Apache Maven and Apache Ant , continuous integration servers such as Jenkins and Hudson and the static code analysis platform SonarQube .
The Copy-Paste-Detector (CPD) is an extension of PMD that uses the Rabin-Karp algorithm to find duplicated code. CPD can be applied to Java, C, C ++, C #, PHP, Ruby, Fortran, as well as JavaScript. The tool can also be run independently of PMD using the Java Web Start technology.
Alternatives
In the Java environment, in addition to PMD, Checkstyle and FindBugs are usually used for static code analysis. With FxCop, Microsoft provides a comparable tool for the .NET platform. See also List of Tools for Static Code Analysis .
Individual evidence
- ↑ Release 6.20.0 . November 29, 2019 (accessed November 30, 2019).
- ↑ PMD Rulesets index. pmd.sourceforge.net, accessed May 5, 2013 .
- ↑ What does 'PMD' mean? pmd.github.io, accessed on April 28, 2018 .
- ↑ Integrations with IDEs. pmd.sourceforge.net, accessed May 5, 2013 .
- ↑ Finding copied and pasted code. pmd.sourceforge.net, accessed May 5, 2013 .
- ↑ CPD (Java WebStart). pmd.sourceforge.net, accessed May 5, 2013 .
Web links
- Book: "PMD Applied" (English). Tom Copeland.