如何在 Intellij Idea 中找到所有未使用的类? [英] How find all unused classes in Intellij Idea?

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

问题描述

有检查未使用声明";它可以在 Intellij Idea 中找到所有未使用的代码.(参见 如何使用 IntelliJ IDEA 查找所有未使用的代码?)但我想找到所有未使用的类,方法、变量等.类.(很难在 3000 个结果列表中只找到类).我该怎么做?

There is an inspection "Unused declaration" which can find all unused code in Intellij Idea. (see How to use IntelliJ IDEA to find all unused code?) But I want to find all unused classes, not methods, variables etc. Only classes. (it is difficult to find only classes in 3000 result list). How I can do that?

推荐答案

  • Ctrl+Shift+A(在 Mac Command+Shift+A)
  • 输入未使用的声明"
  • 双击未使用的声明"
    • Press Ctrl+Shift+A (in Mac Command+Shift+A)
    • Enter "unused declar"
    • Double-click on "Unused declaration"
    • 会弹出设置

      • 点击 Java/声明冗余/未使用的声明
      • 在右下角选择动态编辑器设置"
      • 取消勾选检查字段,...,检查参数.只应勾选检查类".
      • 按确定

      设置关闭

      • 在菜单栏上,单击按名称分析/运行检查(或 Ctrl+Alt+Shift+I - 在 Mac Command+Option+Shift+I)
      • 插入文本未使用的声明"
      • 选择未使用的声明 Java|声明冗余"
      • On the menu bar, click on Analyze / Run Inspection by Name (or Ctrl+Alt+Shift+I - in Mac Command+Option+Shift+I)
      • Insert text "Unused decla"
      • Select "Unused declaration Java|Declaration redundancy"

      搜索开始

      • 在 Idea 底部检查作业状态,完成后:享受结果和清理混乱代码的美妙感觉.:)

      这篇关于如何在 Intellij Idea 中找到所有未使用的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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