I was wondering whether intellij has a feature that would allow it to scan through files and perform things such as organising imports, safely deleting unused functions and fields etc. This feature was very helpful in .NET in Resharper plugin. Thanks for any pointers.
There is a plugin for IDEA - FindBugs-IDEA. It scans for cases you listed and a lot more.