Finding Unused Public Users in Eclipse

I have a class that has 1600 public static members. I have to find and remove unused ones. Is there any way to do this in Eclipse.

+6
source share
2 answers

There is an Eclipse Unused Code Detector plugin ( http://www.ucdetector.org/ ). It can process a specific file or the entire project, looking for unused elements / methods.

+5
source

Ucdetector: You can install the plugin from this link. It works very well, we used it in all our projects. It generates an html report, and can also flag warnings in eclipse. This helps you find unused classes, methods, and variables. The only thing it does not do well is to find if the class is used only through reflection or where the instance is created through spring. In these cases, it still shows that the class is not in use.

http://ucdetector.sourceforge.net/update

Another thing you can do to clean up other types of unconfirmed code is GoTo Window> Preferences> Java> Compiler> Error / Warnings

enter image description here Now find the unsolicited section of code and configure the parameters that you want to clear further.

Hope this helps :)

+6
source

Source: https://habr.com/ru/post/969370/


All Articles