How find all unused classes in Intellij Idea?

后端 未结 4 605
孤城傲影
孤城傲影 2020-12-02 05:57

There is an inspection \"Unused declaration\" which can find all unused code in Intellij Idea. (see this question) But I want to find all unused classes, not

4条回答
  •  死守一世寂寞
    2020-12-02 06:23

    • Press Ctrl+Shift+A (in Mac Command+Shift+A)
    • Enter "unused declar"
    • Double-click on "Unused declaration"

    Settings will pop up

    • Click on Java/Declaration redundancy/Unused declaration
    • on the right bottom select "On the fly editor settings"
    • untick check fields, ..., check parameters. Only Check Classes should be ticked.
    • Press OK

    Settings closes

    • 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"

    Search starts

    • Check the job state on bottom of Idea, when finished: enjoy the results and the great feeling of cleaning up the messed code. :)

提交回复
热议问题