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

查看:617
本文介绍了如何在Android Studio IDEA中找到我项目中所有未使用的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Android Studio IDEA中找到我项目中所有未使用的方法和变量?

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

推荐答案

在android工作室中(或者更常见地在Intellij IDEA中)您可以从 分析 - >检查代码... 指定要分析的检验代码然后定义代码的范围。
您可以在下图中看到我的代码的结果:

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被声明为未使用。此外,在 可能的错误 中,您可以找到变量 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 IDEA中找到我项目中所有未使用的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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