Code Metrics Customization

A number of people have asked:

Is there a way to customize the existing code metrics or add additional ones?

The simple answer at this time is No.  There are no extension points or customizations available at this time for code metrics.  This feature was added late in the cycle for VS 2008 and we were out of time to design and add the required hooks. We will use this release to gather feedback about the sorts of extensions you want. 

To that end please feel free to respond to this post with information about any customizations or additional metrics that would be of interest to you. This will help us a lot in our future planning.

Comments (10)

  1. Li Yang says:

    In certain cases, I still prefer FxCop which is customizable.

  2. Aen Sidhe says:

    Code complexity elements should be customizable, IMO (complexity of cycles, logical operations, etc)

  3. The Visual Studio Code Analysis Team Blog on Code Metrics as Check-In Policy and Code Metrics Customization….

  4. Either implement CQL (I’m not sure if the full spec is publicly available) or add an extension point that will allow you to run NDepend for code metrics. Anything less would be a huge step down for anyone currently doing code metrics with (what I assume) the most common .NET based code metrics tool.

  5. Luo Cao says:

    Is the API of code metrics exposed? If so, we can write a script/C# program to call code metrics API to caclulate the code metrics of our project automatically. By this tool, we can record the code metrics score of the project everyday and watch the trend.

  6. conorm says:

    The API of code metrics is not currently exposed.  The scenario of recording code metrics regularly to evaluate the tren is something we are definitely considering for a future release.

  7. conorm says:

    Luo: Sorry, the API is not exposed.  We are considering this for a future release or at least releasing a command line.

  8. Коллеги озадачили меня вопросом – как в Visual Studio Code Analysis поменять пороговые значения для метрик

  9. [ Nacsa Sándor , 2009. január 19. – február 5.] Ez a Team System változat fejlett eszközrendszert kínál

Skip to main content