Visual Studio 2008 - Code Metrics
One of the new features in Visual Studio 2008 Developer and Team Suite is code metrics. What's cool is its a quick way to do a "How are we doing" check up on code. You can right click and let it run through all your projects in a solution. The results are presented back at the project level, but you can drill down to see what makes up the summary #'s. So for example, if you have a real bad project, you can drill all the way down and find methods that are increasing the complexity for example.
When you run it, green is good, and red or yellow is bad. But there's more to understand about each of the metrics it provides - you can read more in this blog post here about what each of the metrics means.
Reader Comments (2)
I tend to view the code metrics as pretty much useless. There are some significant flaws in the implementation, such as the complexity or a class being the sum of the complexity of all methods. In addition, the inclusion of references to additional libraries decreases the maintainability score, even if you don't use them. Finally, finding the poor metrics can be a challenge, since all nodes are collapsed by default.
Yeah, I would agree they aren't the magic answer to code quality. I do think having it built-in will get more people to take a look and possibly find one or two issues here or there that wouldn't have normally been found.