Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

Calculate solution code metrics with MSBuild 2015

Is it possible to calculate the same code metrics as you get running "Analyze -> Calculate Code Metrics -> On Solution" from MsBuild compilation?

Ideally we would like to get the results on an Excel file (like when you execute "Export to Excel" from the "Code Metrics Result" window) but we could work with other options.

I have been checking the "Code Metrics PowerTool for Visual Studio 2015" but it does not fulfill our requirements as it works on IL (not source code) and you need to indicate an exe and we have several ones.

We have Visual Studio available in the build machine so we can automate it if needed.

Upvotes: 1

Views: 643

Answers (1)

Leo Liu
Leo Liu

Reputation: 76870

Calculate solution code metrics with MSBuild 2015

It seems that almost all of the extension methods are dependent on the Code Metrics PowerTool after Microsoft provided this tool to us. And it works well as expected.

but it does not fulfill our requirements as it works on IL (not source code) and you need to indicate an exe and we have several ones.

If I understand your correctly, you want to calculate solution code metrics automatically, like manual options: "Analyze -> Calculate Code Metrics -> On Solution"? If yes, TFS should be a good recommendation. For the detail info, you can refer to Build Customization in Visual Studio 2015 & TFS 2015 using Code Metrics Utility.

Upvotes: 1

Related Questions