The project(written in Java) is getting large and large and some code will never be used. Is there a way to detect those dead/unuseful code and clean them up. I'm open for ideas.
Asked
Active
Viewed 381 times
0
-
Use an IDE and check if the method call hierarchy. If it's empty, you might not need it. Careful with methods invoked through reflection. – Sotirios Delimanolis Oct 02 '13 at 18:08
-
The answer for that question seems very useful for large projects and long term. I agree for the duplicated. – porfiriopartida Oct 02 '13 at 18:10
-
After reading that post, I myself agree this is a duplicated one. Can someone please close it and mark it duplicated? – Edmond Oct 02 '13 at 18:23
-
You can also link your code to a quality checker like sonar. – Arnaud Denoyelle Oct 02 '13 at 18:26
1 Answers
2
Use an IDE like Eclipse, there you might detect with warnings some of the code that is not used.
It will detect at least non used imports, private methods or local variables that are not used.
It will not detect public methods or attribute since it cannot guarantee that it can be used by someone else. That is something you will have to lookup, make private everything that does not need to be public and then you will get those warning helpers.

porfiriopartida
- 1,546
- 9
- 17