We are in the development period, where there is a lot of code that is being created, which can be short-lived, as it effectively creates forests, which at some point are replaced by something else, but will often continue to exist and be forgotten about.
Are there any good methods for finding classes in a database that are not used? Obviously, there will be many false positives (for example, library classes: you cannot use all the standard containers, but you want to know that they are), but if they were listed in the directory, this can make it easier to look at a glance.
I could write a script that greps for everyone class XXXand then looks for all instances again, but should omit the results for the cpp file in which the class methods were defined. It would also be incredibly slow - O (N ^ 2) for the number of classes in the codebase
Code coverage tools are not really an option here, since it has a graphical interface that cannot easily perform all the functions programmatically.
The platforms are Visual Studio 2013 or Xcode / clang
EDIT: I don't think this is a duplicate of the dead code question. Although there is overlap, identifying dead or inaccessible code is not exactly the same as searching for unaccepted classes.
source
share