1

Possible Duplicate:
What tools and techniques do you use to find dead code in .NET?

Does anyone know of a tool that can find functions that are not being called?

Clarification: functions that are not being called by anything in the solution. Should not matter if they are public, private etc.

Community
  • 1
  • 1
bleevo
  • 1,637
  • 2
  • 18
  • 30
  • This question needs clarification: "not being called"... do you mean private methods in a class not being called by any other methods in the class? Or do you mean which public methods in your whole solution are not being used elsewhere in your application? – mlibby Dec 01 '10 at 03:38

6 Answers6

4

There are several tools available which will do this to varying degrees of depth.

  • Resharper
  • NCover
  • FxCop
JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
1

ReSharper will identify private or internal methods that are not called.

Mark Rushakoff
  • 249,864
  • 45
  • 407
  • 398
1

NCover will give you all kinds of code coverage goodness, however I believe it's a bit expensive.

Ronnie Howell
  • 639
  • 3
  • 8
0

Microsoft's FxCop can do that for you.

Zach Johnson
  • 23,678
  • 6
  • 69
  • 86
  • Only for private members, although here is a good discussion about how it can help http://stackoverflow.com/questions/71518/is-there-a-custom-fxcop-rule-that-will-detect-unused-public-methods – mlibby Dec 01 '10 at 03:34
0

try ncover, its good tool which helps in refactoring a lot

TalentTuner
  • 17,262
  • 5
  • 38
  • 63
0

i myself hate Resharper because their many thing goes wrong in Resharper. you need to use telerik customization it can be better then resharper.