开发者

Find Unused public functions

Is there a way to automatically find all unused public functions in a solution? I have resharper, and right now I have t开发者_运维知识库o do a "find usages" on each symbol, which is tedious--it seems like there should be a better way


Of course there's a better way. Here's what you should do if you use ReSharper 4.5 or later:

  1. Go to ReSharper > Options > Code Inspection > Inspection Severity.
  2. Scroll down to "Unused symbols" category and set all containing items called "Non-private accessibility" to be shown - whether they're shown as hints, warnings, or suggestions is not relevant and is entirely up to you.
  3. In ReSharper > Options > Code Inspection > Settings, check "Analyze errors in whole solution". Press OK to apply changes in ReSharper Options.
  4. Right-click the solution node in Solution Explorer, and select "Find code issues". ReSharper will display various code issues that it detects in your solution in "Inspection results" tool window. Specifically, under "Unused symbols", you'll see all non-private types and members in your code that are not used.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜