Code analysis tools?

I’m currently working with a fairly large java codebase, it’s been about six months since they had an object oriented sofware engineer working on it. So in the mean time the local java team (mostly ex mainframe programmers) have made changes and left cruft lying around.

I know for a fact that there are whole chunks of code (classes and methods) that are never called. However I can’t find any good tools to fix this. I’m using the eclipse IDE, and it can find unusable code for me on a method by method basis. However, I’m looking for something I can point at the 20M of sourcecode and have it produce a list of all unused methods, classes and instance variables.

I have a trial version of IntelliJIDEA here as well, but I can’t see a way of doing it there either.

Does anyone in the java.blogs community know of a tool (free or cheapish) that could do this for me?

Posted on February 21st, 2003 | 2 comments | Commenting Closed
Matthew Cornell

Matthew Cornell February 22nd, 2003 @ 12:14 AM

IDEA 3.0.1 has great support of code analysis, certainly of methods and variable. “Use Tools > Inspect Code…”, select “Inspect Whole Project”, and check everything and run.

Ken

Ken February 22nd, 2003 @ 04:54 PM

There is at least one open source project that does this: PMD at http://pmd.sourceforge.net/ I haven’t used it myself, so I can’t vouch for it.

I used to use a commercial product called JTest that does a great job of this, but it’s pretty expensive. You can get a trial license from them but you have to put up with their sales people harassing you. It’s a great tool, though.

Sponsors

Hosted excellently by RailsMachine