Find “Dead code”

后端 未结 2 569
忘掉有多难
忘掉有多难 2021-02-10 23:05

I am trying to find private methods that are not called from any other code (CA1811) https://msdn.microsoft.com/en-us/library/ms182264(v=vs.110).aspx, with Visual Studio 2012 Co

2条回答
  •  梦如初夏
    2021-02-11 00:01

    The rule CA1811: Avoid uncalled private code perfectly works fine to detect the uncalled private methods.

    To enable the code analysis warnings, you also need to set this value in project properties like this -

    As a suggestion it is good idea to have our custom ruleset, to have more control over rule violations for example you can define any violation as error, so that you can get it as compile error and fix it.

提交回复
热议问题