views:

100

answers:

2

I know that I can access the cyclomatic complexity to my code in Visual Studio 2008 Team Explorer by right clicking and selecting "Calculate Code Metrics". I would like to expose this data for a web application to display it. Does anybody know of any way of accessing this data through an API?

Thanks for your help!

+1  A: 

I use NDepend for stuff like that. You can create CQL queries in NDepend and execute them.
Example:

SELECT METHODS  WHERE CC > 8

returns the methods with a cyclomatic complexity greater than 8.

Paco
A: 

I don't -- does Visual Studio have any APIs of that sort? -- but computing cyclomatic complexity is reasonably easy. Gendarme might be your answer.

Charlie Martin
Is Gendarme be good replacement for fxcop?
Paco