How can I find all unused methods of my project in the Android Studio IDE?

前端 未结 2 975
无人及你
无人及你 2020-12-29 01:07

How can I find all unused methods and variables of my project in the Android Studio IDE?

2条回答
  •  萌比男神i
    2020-12-29 01:21

    In the android studio(or more generally in the Intellij IDEA) you can specify inspection code that you want to analyze from Analyze->Inspect Code... and then define the scope of your code. You can see the result for my code in the below picture:

    In Declaration redundancy you can see that "someMethod" is declared unused. Also, in Probable bugs you can find variable i is never used.

提交回复
热议问题