There are more than few tools that help us maintain the code we write correct and working. We can divide them in source code and class file analyzers.
One of them is PMD, tools that is actively developed since year 2000. It is mature and provides integration with all important IDEs. On the PMD website, developers say that PMD checks:
- Possible bugs – empty try/catch/finally/switch statements
- Dead code – unused local variables, parameters and private methods
- Suboptimal code – wasteful String/StringBuffer usage
- Overcomplicated expressions – unnecessary if statements, for loops that could be while loops
- Duplicate code – copied/pasted code means copied/pasted bugs
In this article we will show how it can be installed and used in NetBeans 6.5.