|
|
Subject: RE: Java code inspection tools - msg#00067
List: programming.language-of-the-year
> I have to evaluate some Java code written by somebody else and I am
> wondering what tools are available to inspect Java code. I
> mean, to check
> code style, find unused variables or methods this kind of things.
> Thanks in advance.
i think intellij idea ( http://www.intellij.com/, free fully functional
trial available) could help you a lot with its inspection feature..
there are also some plugins available for "more improved inspection"..
however, it's not a command line solution..
regards,
daniel
_____________________________________________________
Daniel Lukic
http://www.berlinfactor.com
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/nhFolB/TM
---------------------------------------------------------------------~->
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/pragprog/
To unsubscribe from this group, send an email to:
pragprog-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: Java code inspection tools
Jim Menard wrote:
> On Jan 26, 2004, at 9:32 AM, Jorquera, Lorenzo wrote:
>
>
>>Hi everybody!!
>>
>> I have to evaluate some Java code written by somebody else and I
am
>>wondering what tools are available to inspect Java code. I mean, to
>>check
>>code style, find unused variables or methods this kind of things.
>
>
> findbugs (http://www.cs.umd.edu/~pugh/java/bugs/) has helped me
find a
> few potential problems.
>
> Running the code through Eclipse (http://www.eclipse.org/) helps me
> find unused import statements, but not much else. It's a lot of
effort
> for a relatively minor return.
Both of those are good; check also "PMD"
(http://pmd.sourceforge.net/). Here's the teaser blurb:
PMD scans Java source code and looks for potential problems like:
* Unused local variables
* Empty catch blocks
* Unused parameters
* Empty 'if' statements
* Duplicate import statements
* Unused private methods
* Classes which could be Singletons
* Short/long variable and method names
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/pragprog/
To unsubscribe from this group, send an email to:
pragprog-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Next Message by Date:
click to view message preview
Re: Java code inspection tools
On Monday 26 January 2004 15:41, Jim Menard wrote:
> Running the code through Eclipse (http://www.eclipse.org/) helps me
> find unused import statements, but not much else.
Did you check the Java compiler options?
The latest build 3.0M6 can even give you warnings for bad Javadoc, as well
as undocumented empty blocks, arguments hiding members, unused private
methods, unread members and variables, and so on.
Robert
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Upgrade to 128-bit SSL Security!
http://us.click.yahoo.com/qZ0LdD/yjVHAA/TtwFAA/nhFolB/TM
---------------------------------------------------------------------~->
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/pragprog/
To unsubscribe from this group, send an email to:
pragprog-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Previous Message by Thread:
click to view message preview
Re: Java code inspection tools
On Monday 26 January 2004 15:41, Jim Menard wrote:
> Running the code through Eclipse (http://www.eclipse.org/) helps me
> find unused import statements, but not much else.
Did you check the Java compiler options?
The latest build 3.0M6 can even give you warnings for bad Javadoc, as well
as undocumented empty blocks, arguments hiding members, unused private
methods, unread members and variables, and so on.
Robert
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Upgrade to 128-bit SSL Security!
http://us.click.yahoo.com/qZ0LdD/yjVHAA/TtwFAA/nhFolB/TM
---------------------------------------------------------------------~->
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/pragprog/
To unsubscribe from this group, send an email to:
pragprog-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Next Message by Thread:
click to view message preview
Re: Java code inspection tools
Checkstyle will find unused imports, unused variables, flag methods
without javadocs, or javadocs that don't have parameter lists that match
the method signature. It also is great at enforcing coding conventions.
http://checkstyle.sourceforge.net
JDepend analyzes class files and will tel you dependencies on other
packages. It also generates metrics about abstractness and stability of
packages. Theoretical stuff, but very useful. There is a good article
on it at
http://www.onjava.com/pub/a/onjava/2004/01/21/jdepend.html
JavaNCSS is a tool for measuring the number of non-commenting source
code lines per package, class, and method. It also generates some
metrics about individual methods (McCabe's Cyclic Complexity Number).
Again, theoretical, but useful for detecting code that 'smells' bad.
http://www.kclee.com/clemens/java/javancss/
Macker is a atchitectural rule checking utility for Java. My project
uses it to set up rules such as 'the swing client package cannot
directly use our enterprise java bean package'.
http://innig.net/macker/
PMD is a tool for scanning java source and looks for things like
swallowed exceptions, unused methods & variables, etc. It has similar
capabilities to Macker, but they have slightly different flavors.
http://pmd.sourceforge.net/
On my project, we use all of these tools to produce html documentation
(along with javadoc, and some custom tag docs with xDoclet). With most
on these tools, they generate an XML report that is transformed into
HTML... I've been wanting to research making a stylesheet that would
take all these different metrics and create a single report for each
class or package, rather than a report from each tool. If anyone has
such a thing, I'd like to know about it.
-db
On Mon, 2004-01-26 at 09:32, Jorquera, Lorenzo wrote:
> Hi everybody!!
>
> I have to evaluate some Java code written by somebody else and I am
> wondering what tools are available to inspect Java code. I mean, to check
> code style, find unused variables or methods this kind of things.
> Thanks in advance.
>
>
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/pragprog/
>
> To unsubscribe from this group, send an email to:
> pragprog-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/pragprog/
To unsubscribe from this group, send an email to:
pragprog-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|
|