The worst code I have seen lately was a .net application that had been updated from through the .net versions .net 1.1 to .net 4 using the vs migration update tools but other than sorting out a couple of build errors no changes were made. I was asked to review the code for the company and to add some additional functionality. I was told it would only take a few days. it was terrible created over time by about several consultants hired over the years it had the joy of using 4 of the .net languages (java.net, c#, vb (which is bad enough on its own), and c++) a couple of purchased library for .net 1.1 still being used in .net 4 version, all in a single project no comments never sticking to a single coding style, variable names were just funny words and no unit testing at all. (oh it was also not in version control and was mission critical to the company) Having explained all this o the boss using pretty pictures and fancy words I spent 4 days putting it in to version control and adding in the new functionality to the code that they wanted, and making it live. I then had 10 weeks of fun sorting the whole hornets mess out. The first few weeks converting all the code into just one language c# just to make life easier and adding some basic unit tests. Then started to actually get the code up to scratch and taking advantage of .net 4.0 changes and even the use of masterpages, after about 6 weeks efforts getting the code up to scratch the source code was less than half the size their was unit testing and a heck of alot of major bugs were fixed. Alas after all that effort and actually getting accurate reports about the state of the company from the app they learnt the company was doing crap (were as before due a error were negative were being treated as positive numbers in the finacial system), the company decided ot hire some consultants who advised to move to a purchased system, the company is now bust shame but managements fault.
Good luck