Abhishek
Abhishek

Reputation: 6900

Eclipse plugin to find out unused methods in a class/package

I am looking out for an eclipse plug-in that could be used to detect unused methods or classes across a project. Does any one know a efficient good to use plug-in of that kind?

Upvotes: 9

Views: 10816

Answers (2)

VonC
VonC

Reputation: 1324043

alt text

Of course, any of those tools can NOT deterministically find unused code (see the Halting Problem). Any code could eventually be called, through various means like Reflection.
But those static analysis tools can help.
For additional hints, a good test coverage is still required (dynamic analysis).

Upvotes: 15

BobBrez
BobBrez

Reputation: 723

Something like EclEmma (http://www.eclemma.org/) might be what you're looking for. It shows code coverage for packages, classes, methods and individual lines.

Some lines will never get 100% coverage (e.g. Enums) but it will give you a good idea about what's being used.

Upvotes: 3

Related Questions