This greyed out symbol simply reflects the use of the declaration in other source code files or infrastructure configuration files. A search for using a declaration cannot detect orphaned clusters of classes, as these classes are officially referenced.
There is a technique that can help here: identify some root set of entry points (methods main(), declarations web.xml, etc.) and trace all the links, effectively plotting the classes / methods used. Once the graph is complete, you can consider invisible classes as dead code. Pretty similar to what the Java garbage collector does during a collection of young people. This is quite complicated and requires resources to analyze the code on the fly, so Intellij implements it as a separate check that can be run manually.
, , :
public class Main {
public static void main(String[] args) {
System.out.println(new Used());
}
}
class Used {}
class ObviouslyUnused {}
class TrickyUnused1 {
TrickyUnused1() {
System.out.println(new TrickyUnused2());
}
}
class TrickyUnused2 {
TrickyUnused2() {
System.out.println(new TrickyUnused1());
}
}
, ObvoiuslyUnused . " ":


, , :

, : , , , SPI, .. , anlisys 100 % .