I have a C# project with a large collection of cut-and paste cloned code. I have implemented a method that covers 90% of the usages (about 300 instances), but manually converting them by hand will probably introduce more errors than it fixes. Are there any (preferably free) tools that are designed to help with this?
Basically the Code looks something like this:
////////////// Section marker (sometimes absent)
TempCheck = "SomeFlavour1";
// 5 lines of common code related to TempCheck with various different whitespace and tabbing and newlines
Create new Object of type CSomeFlavour1()
// 20 lines of common code with different whitespace and tabbing and newlines
////////////// Section marker (sometimes absent)
TempCheck = "SomeFlavour2";
// 5 lines of common code related to TempCheck with various different whitespace and tabbing and newlines
Create new Object of type CSomeFlavour2
// 20 lines of common code with different whitespace and tabbing and newlines
I want to reduce these to:
NewMethod("SomeFlavour1","CSomeFlavour1");
NewMethod("SomeFlavour2","CSomeFlavour2");
Hope that makes sense.