如何在 Android Studio IDE 中找到我项目中所有未使用的方法? [英] How can I find all unused methods of my project in the Android Studio IDE?

查看:31
本文介绍了如何在 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:

声明冗余中,您可以看到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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆