Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleIdentifying Dead Code

The Analytics/Semantics Definitions reports can help with identifying dead code.  The Pos_Cnt field is the number of references detected by the tool.  So a zero means not used.

Another, more tedious, way to to identify unused symbols is to look for the symbol in the Analytics/Semantics References report.  If a symbol is not shown NOT FOUND as referenced in the References report, then it may be dead and the Definitions.corresponding record for the symbol in the Definitions report should have Pos_Count should be =zero. 

So, you You need to be careful interpreting the these results. Some things to be aware of: event-handlers may be needed but not are rarely explicitly called, and late calls (CallByName and dynamic) are not counted detected either. So it is possible to detect 0 calls, but still have calls at runtime.  And, this It is a critical to audit the code for late calls and refine the upgrade solution to enhance type inference hints if you are finding unexpected late calls. Also, the dead code analysis gets more difficult when dealing with a members in COM DLLs. One would need to must inspect all client code that might use the DLL to see if the member is called through COM.  This is only possible if you have source code for all clients. If you only have Standalone EXEs, this complexity is not a concern.
 

The Assessment Report workbook we prepare for a Smart Start includes a Member Counts report that combines the Definitions, References, and _MEMBER_ search Search report data to compute a usage and facilitate dead code analysis.  The assessment Smart Start Assessment Reports also accounts for multi-component systems and calls through COM.

...