Is there anyway to calculate the Code Metrics for a VS 2010 Ultimate solution, but to omit the Code Contracts?
Right now, my best idea is to do a calculation, dump the excel file, then reflect over the IL of each class, count the amount of lines referencing a contract, and then subtract that amount from the lines of code for that method. The problem is that it's way more work than it's worth, and I'll only be able to shave off lines-of-code, but I still have the resulting cyclomatic complexity measures, etc.) Better ideas?
If you're determined to do this (which, like Ira, I wouldn't particularly recommend), a fairly easy way to exclude the contracts from your metrics would be to compile without runtime contract checking enabled, then run the metrics against that compiled version.