I was under a tight deadline to finish a project in C#, and as a result I feel I didn't code things in the most efficient way. Now that I have time to go back and optimize the code, I was wondering if there was a Visual Studio extension or other program/service to highlight blocks of code similar to each other. This way I can break them off into functions as I need to.
Atomiq is a nice little app that does a pretty good job at finding duplicate blocks of code. It was written for .NET (I think it was written in WPF) and analyzes your source code files. It is not free, it costs about $30 US.
I have used it in the past and one of the things I like about it is you can set the sensitivity of the duplication by specifying lines of code of code to look for. If you only want to find really bad duplication you could set to to 10 lines of code and it will find everywhere a specific 10 lines are duplicated. You can go all the way down to one or two lines of code, but that is going to find a lot of false positives.
Not all is rainbows and sunshine with the program, it tends to report duplicates twice, once for each file it finds. Well at least in the version I used. So if Foo has a block of code that is also in Bar then you will see that block of code counted twice. And it tends to have performance issues with really large (100,000+ lines of code) projects. They may have fixed that with a newer version, I haven't had a chance to check.