I would say no; except for the "dead code" that the compiler can detect.
My definition of code coverage is a result that indicates how many times each line of code runs in your program: which, of course, means starting the program. The determining factor here is, as a rule, the values โโof the data passing through the program, which determine the execution paths executed by the symbols. Static analysis, like the compiler, can output lines of code that cannot be executed under any conditions.
An example here is that your program uses a third-party library, but there is an error in the library. If your program never uses those parts of the library, or the data that you send to the library makes it avoid errors, then you will not be affected.
You can write a program that, by reflection, assumes that all conventions are accepted, and follows all function calls through all derived classes, but I'm not sure what this will tell you. This, of course, cannot tell you if there are errors in the lines of code.
source share