Is there a tool for finding unreferenced functions (dead, obsolete code) in a C# app? [closed]

Gendarme will detect private methods with no upstream callers. It is available cross platform, and the latest version handles “AvoidUncalledPrivateCodeRule“.

FxCop will detect public/protected methods with no upstream callers. However, FxCop does not detect all methods without upstream callers, as it is meant to check in the case that your code is part of a Library, so public members are left out. You can use NDepend to do a search for public members with no upstream callers, which I detail here in this other StackOverflow answer.

(edit: added information about Gendarme which actually does what the questioner asked)

Leave a Comment