Static Analysis of Java Programs with PMD

PMD is an open source tool that analyzes Java source code to find potential bugs.PMD scans Java source code and looks for potential problems like:

  • Empty try/catch/finally/switch blocks
  • Unused local variables, parameters and private methods
  • Empty if/while statements
  • Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
  • Classes with high Cyclomatic Complexity measurements

PMD can also be integrated with Ant for automatic source-code checking, and plug-ins exist for most major IDEs and programmer’s editors.

I recommend an Elliotte Rusty Harold’s article titled Zap bugs with PMD. It is an introductory reading about installing, configuring, and running PMD.

This entry was posted on Friday, March 11th, 2005 at 2:58 AM and filed in Software Engineering, Java Computing. Bookmark this entry. Follow the comments here with the RSS 2.0 feed. Comments are closed, but you can leave a trackback.

Comments are closed.