Android/Java Static Code Analysis Tools

Java/Android compilers in itself are very good and give very good warnings to inform about various issues/things done wrong.

Just thought about trying free Static Code Analysis Tools and found the below:

  1. FindBugs
  2. PMD
All have eclipse plugin urls, so you can add the URLs at the software site link and easily add the plugins.

Damn good tool. Install the plugin and then right click on a java/android project. You will find FindBugs Menu. Just click on FindBugs and it gives a very good overview of the review bugs in it's own perspective.

Each of the bugs is categorized by the pattern (you can change the categorization in the toolbar) and it lists all the occurrence of that type in all files in the project under that. 
Clicking on it, it gives a very very good description about what the error is and why that is considered to be an error. It indicates if its just a suggestion or performance issue or style issue.  Some of these were quite new for me and the explanation made me feel good to have learn something.
It has mechanisms for marking/filtering out the warnings/bugs we know doesn't make sense in our case -  either file by file or by the pattern type.
It gives a handy way to save the results in XML format too.

All in all, a professional tool/plugin which does it job well.  

PMD 
I wasn't very impressed with this tool. Similar features of finding issues as FindBugs but gives issues in file by file manner. One useful feature is "Find Duplicate Code" which might be useful in some cases but not when you have various design levels for same data objects and it says code is repeating in the classes.

Others found on forums and google search but haven't tried yet:

CheckStyle
Mainly enforces coding standards though the documentation says they have started adding more checks than for UI layouts only.

CodePro Analytix
From Google Web Toolkit. Has lots of good features like dependency analysis, source code repetition, metrics, code coverage etc. Need to try this.

JTest

Julin Online Analyzer
Upload online and select category like checks, nullness, termination etc.

JChord
More details at http://pag.cc.gatech.edu/chord/

Do you use any of the tools above or any other tool which you have been impressed with? Do share it in comments.

Comments

Popular posts from this blog

Temples in Bangalore!

Blogspot.in?

Booked my first car!