Removing unused functions in Visual Studio

If you are using one of the Visual Studio plug-ins, you can quickly refactor your code to remove unused functions.

A defined but unused function can lead to development confusion, such as the wrong function with a similar name being called. On rare occasions, the unused function can also find its way into the final executable, which can lead to other vulnerabilities. Klocwork provides two checkers that identify unused functions:

  1. To fix one of these issues, right-click the issue marker on the left margin of the editor and choose one of the following actions:
  2. For UNUSED.FUNC.GEN, choose Remove unused function.