Find Unused public functions

后端 未结 1 757
清歌不尽
清歌不尽 2020-12-25 12:07

Is there a way to automatically find all unused public functions in a solution? I have resharper, and right now I have to do a \"find usages\" on each symbol, which is tedio

相关标签:
1条回答
  • 2020-12-25 12:39

    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 讨论(0)
提交回复
热议问题