Detailed steps for finding methods that are not referenced in the idea project

need

I received a request today and commented out the methods that were not referenced in the project. After receiving the request, I opened the project as usual and saw a lot of code. I thought that this project has been iterated for many years. Who is still here? Remember whether those methods have been called, so after thinking about it, I remember that idea has a built-in operation that can help us find methods that are not referenced. See my operation below.

Environmental preparation

IntelliJ IDEA 2022.2.1 version

Implementation steps

Open idea, find Code->Inspect Code tool->Whole project and find Unused declaration (the methods in this drop-down box are methods that have not been called)

insert image description here
insert image description here![(https://img-blog.csdnimg.cn/f8c7a68060844ad992e99dab3369d132.png)
insert image description here
Note: If there is no Code in the previous idea version, go to Analyze->Inspect Code

Guess you like

Origin blog.csdn.net/weixin_51966599/article/details/127629649