How to remove a lot of useless abandoned code in idea?

How to easily find unused private methods, classes and variables in the entire project?
Similar to ↓
insert image description here
, it means that the class is not referenced anywhere. At this time, such a class remains in our project, taking up space in vain, slowing down the startup speed, and increasing the cost of reading code.

How to easily and quickly capture these useless codes at one time?

Here is a very simple way: ↓
Step 1: First find the code —> inspect Code
My idea here is the 2021.3 version of the mac system
Please add image description
Step 2:
Please add image description
Select the whole project, and then click ok
to scan the code in the entire project

Step 3:
Please add image description
At this point, you can see useless methods in Unused declaration

Guess you like

Origin blog.csdn.net/GBS20200720/article/details/124458013