Finding unused methods in scala using Intelli J
Asked Answered
C

1

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.

Conjunctive answered 4/2, 2016 at 11:42 Comment(3)
As far as I know you can't get it any more specific. But anyways, unused vals and vars are at least as important as unused defs.Psalterium
thanks bash0r. Yeah but I was thinking if there was any IntelliJ plugin to get this capability.Conjunctive
Sorry, nothing I'm aware of.Psalterium
A
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.

Adductor answered 4/2, 2016 at 12:45 Comment(4)
Cannot find Unused Declaration under Scala language when I click on "...". When I filter, I can see only "Unused Symbol" under Scala.Conjunctive
Try to search "unused declaration" in the search bar in the window that opened after you clicked on "..."Adductor
I am still to find that option for Scala... for Java I can see it but haven't come across anything so far.Jansenism
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...Pires

© 2022 - 2024 — McMap. All rights reserved.