PMD (Software)

PMD is a tool for static code analysis of source code. In addition to Java, among others, JavaScript, XML and XSL, and it supports derived dialects. The name PMD itself has not officially advertised importance.

Bug fixes

The errors that it finds PMD are typically no real fault, but rather inefficient code, ie the software will still work correctly in general, if the errors are not corrected. PMD is based on static rules 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
  • About Complicated expressions - unnecessary if- expressions, or for loops that could be used instead as while loops
  • Suboptimal code - wasteful use of String / String Buffer
  • Classes with high Zyklomatischer complexity.

PMD offers a variety of built-in rules and the ability to extend existing rules or to write their own rules.

Extensions and plug -ins

PMD provides plug-ins ready for development environments such as JDeveloper, Eclipse, JBuilder, NetBeans, JCreator and IntelliJ IDEA and editors like JEdit, Emacs and TextPad. In addition, extensions for build tools such as Apache Maven and Apache Ant, continuous integration server like Jenkins and Hudson as well as the static code analysis platform sonar exist.

The Copy-Paste Detector (CPD ) is an extension of PMD, which uses the Rabin - Karp algorithm to find duplicated code. CPD can be applied to Java, C, C , C #, PHP, Ruby, Fortran, and JavaScript. The tool can also be independent of PMD, are executed using the Java Web Start technology.

Alternatives

In the Java environment, usually in addition to PMD also Checkstyle and FindBugs for static code analysis are used. Microsoft provides a comparable tool for. NET platform with FxCop.

653889
de