3

Anyone knows any free Visual Studio add-in that would find and/or delete dead (unused) code? I saw such possibility in MZ-Tools, but it's a little expensive as for private use ;)

brovar
  • 811
  • 4
  • 10
  • 25

2 Answers2

2

Depends... For .NET you can use FxCop for finding usused code and variables.

Simon Linder
  • 3,378
  • 4
  • 32
  • 49
  • Hmm, but FxCop analyzes the managed code. I'm not sure if it would do the thing? – brovar Mar 29 '10 at 09:34
  • You get warnings like: CA1804: Remove unused locales; or CA1811: Avoid uncalled private code; So I would say that is something... – Simon Linder Mar 29 '10 at 09:37
1

You can also install ReSharper. It generally warns about unused variables and methods in a class file. You can see it as you are coding. It underlines it. It does seem to miss a couple but FxCop did seem to find the rest for me.

UPDATE: Sorry didn't see the FREE part. BUT after using ReSharper for a while it is definitely worth the money.

uriDium
  • 13,110
  • 20
  • 78
  • 138