Search code examples
tfs-sdk

TFS SDK Code metrics


I am making some kind of wrapper around the TFS SDK. I would like to query the code metrics from a given project on a given URL.

MS Visual studio has a feature to calculate the code metrics inside the IDE. Is it possible to do this on a TFS server and query it from the Warehouse ? I would be interested in

  • cyclometic complexity
  • depth of inheritance
  • class coupling
  • lines of code
  • maintainability index

and even more metrics if it is possible

Thanks in advance


Solution

  • By using this utility, you can generate a "metrics.xml" for each project/solution.
    I am using TFS2010 & have inserted this as a build step, following this guide by J.Ehn.

    Those results are not inserted into TFS-persistency in any means - but in theory, you could set up an own database where this output shall be inserted. From then on, you could retrieve as you wish.