Question

I'm a NetBeans 6.5 user and am searching for a way of generating a list of methods/classes that are not used within a set project group.

I know I can right click on each method and select "Find Usages" but I'm looking for an automation to that process.

I'm willing to look at something that runs outside of netbeans, as long as it generates a list of cruft methods/classes.

Thanks.

Was it helpful?

Solution

Obfuscators like proguard can shrink your jars by removing unused methods/classes. Maybe it is possible to get a verbose output which contains the list of removed (hence unused) classes/methods.

Here you can find more information about finding dead code with proguard.

OTHER TIPS

You can switch on the unused code rules in PMD (there's a NetBeans plugin), then run PMD over a whole project.

Use a test coverage tool to instrument your codebase, then run the application itself, not the tests.

Emma and Eclemma will give you nice reports of what percentage of what classes are run for any given run of the code.

There are several tools you can use to help find these and other problems:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top