remove unused code

I am currently evaluating ReSharper.
Is it possible to find unused code and remove it with ReSharper?
With unused code I mean classed which never get referenced. also functions, methods and properties inside the classed which get never called from the project.

Thanks,
Alex

7 comments
Comment actions Permalink

I also have the exact same question.

I'm using C# .NET 2.  I want to find dead code that is unreferenced in an entire solution, statically, not in a runtime test.

0
Comment actions Permalink

I am also working with some huge libraries where I need only a small percentage of code and want to get rid of all extra unused code. This libraries have hundreds of classes with many cross references. Some Blogs pointed me to ReSharper becasue as teh solution, which I have not found yet in ReSharper.

Alex

0
Comment actions Permalink

Hello Alexander,

In ReSharper 4.5 solution-wide unused members will be highlighted in gray
(as other redundant code). This functionality is not available in released
versions, but local analysis about unused code is ReSharper feature for years.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


AG> I am currently evaluating ReSharper.
AG>
AG> Is it possible to find unused code and remove it with ReSharper?
AG>
AG> With unused code I mean classed which never get referenced. also
AG> functions, methods and properties inside the classed which get never
AG> called from the project.
AG>
AG> Thanks,
AG> Alex
AG> ---
AG> Original message URL:
AG> http://www.jetbrains.net/devnet/message/5227802#5227802


0
Comment actions Permalink

It would be useful to list unused classes and methods in one place after compiling.  It will not be very productive to page through thousands of lines of code, looking for highlights.

0
Comment actions Permalink

Hello G Applqst,

This is something we plan to do, but not in nearest versions. Probably FxCop
can do it?

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> It would be useful to list unused classes and methods in one place
IR> after compiling. It will not be very productive to page through
IR> thousands of lines of code, looking for highlights.
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5228380#5228380


0
Comment actions Permalink

G Applqst schrieb:

It would be useful to list unused classes and methods in one place after compiling. It will not be very productive to page through thousands of lines of code, looking for highlights.


http://ndepend.com/ is your friend for that.

Regards

Albert

0
Comment actions Permalink

Thanks a lot.  Definitely Answered.

0

Please sign in to leave a comment.