Saturday, 24 November 2012

Java Code Review Tool

One of the most painful but important steps of a java project, is the code review. checking and reviewing thousands of lines of some body else's code for small things like braces, name style, documentation and overall design can really knock you out and make you feel like there is a heavy rock right on the top of your heart.

fortunately, there are tools to reduce your pain and automate this precudrue as mush as possible. There are 2 tools that I am familiar with, each of them has their own features, and by using them together, really can make your life much easier.

first one I recommand is CheckStyle. But its checking rule is too strick, so you better set up your own one. It checks for the followings in your code:
  1. Java comments and docs
  2. naming conventions
  3. header
  4. imports
  5. size violations
  6. white space
  7. blocks
  8. modifiers
  9. and etc.
second one is PMD, it is meant to check the overall design of your codes. such as:
  1. empty catch block
  2. unused if statement and local variables
  3. duplicate codes
  4. classes that could be singletons
  5. inproperiate variable and method names
  6. and etc.
And also, there are still a lot of tools that you can find in interenet to help you fight, instead of wasting those extremely power tools, from now, pick them as your weapons and armors, and beat the code review.

No comments:

Post a Comment