6

In recent earlier versions of Visual Studio (i.e.: earlier than VS2017), Microsoft released a separate code metrics powertool that could be run through the command line and generate an XML containing certain code metrics (such as lines of code, complexity, and maintainability) for your codebase. Details about the tool here.

As far as I can tell, they have not released a version of this tool that works based on a VS2017 install. While the VS2017 IDE does contain a tool to generate and even export these metrics (under Analyze->Calculate Code Metrics), I can't figure out a way to use it via the command line so that the process can be automated.

Is there a way to do this without 3rd party software?

NickH
  • 61
  • 3
  • You can still use the tool NDepend that proposes many code metrics, that integrates into VS2017 and that has many facilities to export and visualize code metrics values, but it is 3rd party software. http://www.ndepend.com/docs/code-metrics – Patrick from NDepend team Jul 28 '17 at 08:12

1 Answers1

2

For VS2017, there is currently no command line support to 'Calculate Code Metrics' - as you say it is only present in the IDE.

In previous versions of visual studio, this functionality was provided by via the CodeMetrics Power Tool.

You can see an issue raised here for lack of Power Tool support in VS2017:

https://developercommunity.visualstudio.com/content/problem/142328/code-metrics-powertool-missing-for-vs2017.html

where the Visual Studio team states that they currently do not have any plans to produce the power tool.

Therefore, at this point in time, you will require 3rd party software.

aclement
  • 21
  • 2