Usual dead code detectors don't seem to find which defined objects in a Guice or Gin module are not needed any more: is there a simple way to detect this?
For example, let's say I defined a Provider method for a type with a certain annotation:
@Provides @Named("string range")
String getStringRange(Request foo) {
return foo.getBarProperty();
}
...only at some point this no longer needs to be injected anywhere and is forgotten to be removed from the module. Is there any way to auto-detect dead code in these Guice modules?
Update: Since the only answer so far basically says "look manually" (though the Grapher idea is helpful for manual inspection), I'm adding a bounty to see if there is really is no way at all to auto-detect dead code in guice or gin modules.