Hamish Grubijan
Hamish Grubijan

Reputation: 10820

How to systematically remove and re-factor unused C# code?

I have copied an older open source project (C# 2.0-ish, VS2010). It does what I need, but it is not great and there is too much junk code. I think only 20% of it is being used. I would like to remove everything that I do not need, before I can start to re-factor. Are there any tools that can help me do this?

Upvotes: 1

Views: 215

Answers (3)

Tim Jarvis
Tim Jarvis

Reputation: 18815

As well as the refactoring tools suggestions, there are 2 other things that you need.

1./ Source control (so you can roll back if you need to)
2./ Whiteboard (or some other place to nut out a high level design)

Upvotes: 1

Austin Salonen
Austin Salonen

Reputation: 50215

NCover will help you find all the unused code assuming you have unit tests.

Upvotes: 0

Madhur Ahuja
Madhur Ahuja

Reputation: 22661

Resharper is your best friend. http://www.jetbrains.com/resharper/

Get the trial version.

Upvotes: 4

Related Questions