Static Analysis tool recommendation for Java?

JavaStatic Analysis

Java Problem Overview


Being vaguely familiar with the Java world I was googling for a static analysis tool that would also was intelligent enough to fix the issues it finds. I ran at CodePro tool but, again, I'm new to the Java community and don't know the vendors.

What tool can you recommend based on the criteria above?

Java Solutions


Solution 1 - Java

Solution 2 - Java

FindBugs, PMD and Checkstyle are all excellent choices especially if you integrate them into your build process.

At my last company we also used Fortify to check for potential security problems. We were fortunate to have an enterprise license so I don't know the cost involved.

Solution 3 - Java

I recommend FindBugs. http://findbugs.sourceforge.net/ Good in assisting to do code review.

Solution 4 - Java

IntelliJ IDEA from JetBrains. They also do ReSharper in the .Net community.

Solution 5 - Java

Sonar is a quality control tool. It gauges quality of Java applications through the observance of coding rules conventions, metric measures and advanced indicators.

Sonar is based on the following projects :

You could also use Simian for duplication detection.

Solution 6 - Java

CRAP4J is not only an awesome name but it's quite useful. The other good ones are all above, best of all (IMHO) is FindBugs, because it really does find honest-to-goodness bugs right away in a big code base.

Solution 7 - Java

You can try JavaDepend, it complement other static analysis tools, and provides a CQL language to query code like database,

JavaDepend provides also many interactive views to understand the existing code base and more than 82 metrics.

Solution 8 - Java

All the above are great tools. PMD is probably the most common.

Another tool is Enerjy. It recently became free, so you can download it and try for yourself. Enerjy is somewhat more organized and a better fit to larger teams. It makes it easier to customize and share the rules. Personally, I'm not a big fan, but maybe you'll fancy it more than I do.

Solution 9 - Java

Couple of commercial vendors that have a Java offering:

Klocwork Coverity

They won't "fix the issues" they find (nor will, I believe, any of the other ones mentioned above) but these are all tools that have varying strengths.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsergebView Question on Stackoverflow
Solution 1 - JavaEduard WirchView Answer on Stackoverflow
Solution 2 - JavaBrian MatthewsView Answer on Stackoverflow
Solution 3 - JavazxcvView Answer on Stackoverflow
Solution 4 - JavaSaaS DeveloperView Answer on Stackoverflow
Solution 5 - JavaJulien HoarauView Answer on Stackoverflow
Solution 6 - JavaEpagaView Answer on Stackoverflow
Solution 7 - JavaJames from CppDepend TeamView Answer on Stackoverflow
Solution 8 - JavazvikicoView Answer on Stackoverflow
Solution 9 - JavaAndyView Answer on Stackoverflow