Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding unused methods in scala using Intelli J

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.

like image 844
Rahul Kosambi Avatar asked Feb 04 '16 11:02

Rahul Kosambi


People also ask

How do I delete unused variables in IntelliJ?

In IntelliJ, in a . java file, some unused code is greyed out indicating that the declared variable or function is never used. Unused imports are removed using Ctrl+Alt+O.

Does IntelliJ work with Scala?

To start working with Scala in IntelliJ IDEA you need to download and enable the Scala plugin. If you run IntelliJ IDEA for the first time, you can install the Scala plugin when IntelliJ IDEA suggests downloading featured plugins. Otherwise, you can use the Settings | Plugins page for the installation.

How do I get Scala class in IntelliJ?

On the Project pane on the left, right-click src and select New => Scala class. If you don't see Scala class, right-click on HelloWorld and click on Add Framework Support…, select Scala and proceed. If you see Error: library is not specified, you can either click download button, or select the library path manually.


1 Answers

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

like image 181
Liza Shakury Avatar answered Oct 13 '22 21:10

Liza Shakury