Does anyone know if there is a an Intellij inspect...
# android
t
Does anyone know if there is a an Intellij inspection or a lint rule that can mark dependencies as unused?
Copy code
class SomeActivity @Inject constructor() {
    @Inject
    lateinit var notUsed: UnusedClass
}
Over the years, classes have built up with unused dagger classes
@Inject
properties . It’s hard to clean this up manually over an entire codebase.
r
Not sure what you mean by “classes have built up unused dagger classes”.If your trying to suppress a warning you can do @SuppressWarnings(“unused”)
If your just trying to find them with a static analysis tool, There are third party libraries like klint that will pick up on that
There is also a errorprone , which can give dagger optimization suggestions
j
error prone is for Java
👍 1
r
ahh I see, so there is no kotlin integration for it
j
it's a Java compiler
t
Not sure what you mean by “classes have built up unused dagger classes”.
Sorry, I’ve updated the grammar.
👍 1
r
Interesting, even though I have used it in a codebase that had both Java and Kotlin, and it was still able to issue code improvement suggestions to the dagger modules.
@tevjef yea if lint is not working for you, just look into a 3rd party static analysis tool.