9

I am working on a scala project in IntelliJ and want to clean up my code. For this, I am looking for a way in which I can get a list of unused methods within my project.

This link didn't answer my question. It is for Java and not for Scala. Finding unused methods in IntelliJ (excluding tests)

Analyze -> Inspect Code for Scala in IntelliJ has an option to select unused symbol but I am unable to drill it down to only check methods.

Community
  • 1
  • 1
Rahul Kosambi
  • 113
  • 1
  • 7

1 Answers1

4

Go to Analyze -> Inspect code Under Inspection Profile click on "..." and make sure "Unused declaration" is checked. Chose Whole project option and then OK.

Liza Shakury
  • 670
  • 9
  • 20
  • 5
    Cannot find Unused Declaration under Scala language when I click on "...". When I filter, I can see only "Unused Symbol" under Scala. – Rahul Kosambi Feb 08 '16 at 09:21
  • 1
    Try to search "unused declaration" in the search bar in the window that opened after you clicked on "..." – Liza Shakury Feb 08 '16 at 10:47
  • 7
    I am still to find that option for Scala... for Java I can see it but haven't come across anything so far. – Havnar Dec 06 '16 at 12:34
  • 1
    It doesn't seem to include the play framework references that occur in the generated code from the routes file. It ended up removing those functions... – Traveler Aug 16 '17 at 21:09