8

I have big project my manager dedicated to me for remove unused Classes form the project.

i finding good tool for it which give me list of classes which are not used in project..

can apache hama do it?? or suggest any other tool

1
  • 3
    It's a very difficult task to do if you don't master all the frameworks and technologies used by the application. A lot of classes might appear as not used just because they're referenced in some config file, instantiated and used through reflection. And on the other hand, you could have a set of classes mutually referencing each other, but that are never used in the application. You'd better have a set of automated integration tests covering the whole app before doing that. Commented Jul 28, 2012 at 10:33

2 Answers 2

6

You can try

Unused Code Detector

An eclipse plugin which might help you. To add to that if the classes are being used via reflection then there will be some problems.

Also read:

The problems found by UCDetector, are only suggestions. Before changing code, you should really know what you are doing! If UCDetector tells you, that there are no references your code still may be used by:

Reflection
Frameworks like Spring, Hibernate or Eclipse which declare dependencies in property files, xml files (extension-points) ...
Third party code, which is using your API
Jars in your workspace
To be continued...

Change visibility may cause problems with inheritance, reflection, instantiation...

It's good idea to do a full text search in workspace for the piece of code, you want to change.

Sign up to request clarification or add additional context in comments.

Comments

2

IntelliJ IDEA has an excellent static analyzer that includes dead code detection. For a limited set of languages and frameworks, it is also available in the free community edition.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.