如何在Android Studio IDE中找到项目中所有未使用的方法? [英] How can I find all unused methods of my project in the Android Studio IDE?
问题描述
如何在 Android Studio IDE 中找到项目的所有未使用的方法和变量?
How can I find all unused methods and variables of my project in the Android Studio IDE?
推荐答案
在android studio(或更常见的Intellij IDEA)中,您可以指定要从 Analyze->Inspect Code...
分析的检查代码>,然后定义代码范围.
您可以在下图中看到我的代码的结果:
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:
在 Declaration redundancy
中,您可以看到"someMethod"被声明为未使用.另外,在 Probable bugs
中,您可以找到从未使用过的变量 i
.
In Declaration redundancy
you can see that "someMethod" is declared unused. Also, in Probable bugs
you can find variable i
is never used.
这篇关于如何在Android Studio IDE中找到项目中所有未使用的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!