I’m trying to use static code analyzers to streamline my code and make it more readable. The code’s supposed to be open source, and I want it to actually be useable.
This isn’t about performance so much as usability, but I wasn’t sure where else to put this.
I’ve been getting my static code analyzers in the form of eclipse plug-ins.
First, I tried Unnecessary Code Detector (http://www.ucdetector.org/). This worked pretty well. I shut off all the warnings about changing visibility because most of them seemed unimportant, but I found the plug-in useful for removing unused code. It also helped me find a few class stubs that I had created with the intention of implementing specific features. I now have these specific features listed on my todo list so that I can implement them.
It also has the ability to check for dependency cycles (where class A calls class B and class B also calls class A). Limiting dependencies is desireable, though I didn’t do much with this. It simply wasn’t worth the time sorting out the mess. Some of the cycles are perfectly acceptable for various reasons.
Second, I tried PMD (http://pmd.sourceforge.net/). This found a ridiculous number of problems, most of which seem to be about obscure code style issues that seem somewhat arbitrary to me. I am changing some of my code to match their naming conventions and such, but many of the warnings appear to be unimportant.
Does anyone have any advice about any other static code analyzer plug-ins to use or any comments about their experiences with static code analysis?