aspose file tools*
The moose likes Testing and the fly likes Free Automatic CodeReview tool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Free Automatic CodeReview tool" Watch "Free Automatic CodeReview tool" New topic
Author

Free Automatic CodeReview tool

Adi Kulkarni
Ranch Hand

Joined: Mar 12, 2009
Posts: 86
Hi all,

I was looking for a free automactic code review tool which can help me generate code review reports. Kindly help me with the same

Thanks,
Aditya


SCJP 1.5
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

I'm not sure what exactly you are looking for, but I would suggest to have a look at: Checkstyle, Findbugs, PMD and maybe Testability Explorer.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Agreed; it depends on what you mean by "code review". To me, a "code review" is a collaborative gathering of people's opinions about the code, potential issues, and things like that--something automated tools can't really do (although FindBugs can... well, find bugs, and Checkstyle can enforce coding standards, and PMD does a bit of both).
Adi Kulkarni
Ranch Hand

Joined: Mar 12, 2009
Posts: 86
Thanks Joachim and David,

I'm looking for a code review tool which will check the coding standards,efficient use of the data structures, check if the code is optimised. If there is some unused variable etc. I tried PMD bug unfortunately the binary for that is continuously crashing. Also Findbugs doesnt generate a report(please correct me if I'm wrong).

I also tried downloading Hammurapi, but the same problem that the executable is crashing

Thanks,
Aditya
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11481
    
  94

I've started to use Sonar at both work and at home. Very useful for:
  • rules compliance
  • code coverage
  • identifying standard "problems" as per FindBugs and PMD (e.g. unused variables)
  • identifying duplicated code
  • identifying too complex code


  • And more.

    Note that it is a relatively heavyweight application, and by default it requires your projects to use Maven (although there is a way around that by using a Hudson Sonar plugin).

    Hudson itself has many plugins that will give you some of the reports that Sonar provides. But not all of them. I tend to use Hudson as my CI tool with Sonar triggered by Hudson each night (the creators of Sonar recommend it run as a daily build).

    FindBugs does generate reports in many formats - take a look at this sample report on the JBoss codebase as an example. Personally I don't like the way they do reports - it is non intuitive to me that the top 4 items work as tabs that you can click on, or that there is drill-down information on some screens (e.g. the "List bugs by bug category" screen). I tend to use FindBugs within Eclipse itself (there are plugins for most IDEs) and also generate a more generic XML report from the standalone FindBugs report that Hudson understands and can incorporate into it's daily build information.


    The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
    Adi Kulkarni
    Ranch Hand

    Joined: Mar 12, 2009
    Posts: 86
    Thanks a lot,

    Can I use SONAR as a stand alone tool for generating reports ?

    Thanks,
    Aditya
    David Newton
    Author
    Rancher

    Joined: Sep 29, 2008
    Posts: 12617

    FindBugs creates reports; otherwise what use would it be?
    Michael Couck
    Ranch Hand

    Joined: Nov 15, 2003
    Posts: 46
    Hi,

    Sorry to dredge up this old post but you can use Hudson and Serenity(http://wiki.hudson-ci.org/display/HUDSON/Serenity+Plugin) for code coverage, complexity, dependency, abstractness and distance. And of course FindBugs plugs in to Hudson as well, the two together will give you more than enough metrics to judge the code quality.

    Hope this helps,
    Michael
     
    Don't get me started about those stupid light bulbs.
     
    subject: Free Automatic CodeReview tool