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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With