Can IntelliJ's code analysis options be configured so that it can tell me if code is only used by tests (mostly unit tests) so that I can remove what is essentially dead code from the project.
Coverage in the Coverage tool window If you want to reopen the Coverage tool window, select Run | Show Code Coverage Data from the main menu, or press Ctrl+Alt+F6 . The report shows the percentage of the code that has been executed or covered by tests. You can see the coverage result for classes, methods, and lines.
In newer versions of IntelliJ it's under Code -> Analyze Code -> Run Inspection by Name. Show activity on this post.
Rerun tests automatically In IntelliJ IDEA, you can enable the autotest-like runner: any test in the current run configuration restarts automatically after you change the related source code. Click. Toggle auto-test on the Run toolbar to enable the autotest-like runner.
Specify the scope of your analysis to "Project Production Files", and untick "Include test sources". This will skip any unit tests that are in folders labeled as "test".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With