I want to delete foo() if foo() isn't called from anywhere.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
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)