Finding problems in Java code with PMD

In order to enforce correct and consistent invocation of log4j logging framework in application code, I decided to take a look at PMD – Java source code analyzer. My initial intention is to run PMD with 'Java Logging ruleset' only during each build executed with QuickBuild (LuntBuild). The build will fail, if violation is found. It may be annoying for our development team, but on the long run I'm certain that the whole team using code analysis tool like PMD will progress faster and finally developers would learn to write better code. Personally I would like to detected log4j problem in advance, but not after the code deployed to any environment. Perhaps in the future we would want to integrate PMD with Eclipse IDE, so developers would see log4j issues directly on the Eclipse IDE and commit only good code to Subversion.

No comments: