VS 2015计算代码指标失败 [英] Calculate Code Metrics fails VS 2015

查看:107
本文介绍了VS 2015计算代码指标失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

G'day民谣,

使用Visual Studio 2015 Update 2尝试计算特定项目的代码指标会导致以下错误消息:

Using Visual Studio 2015 Update 2, attempting to calculate code metrics for a particular project results in the following error message:

"计算目标文件的代码指标时发生错误. <文件路径> 在项目<项目名称>中.解析方法< method>"的IL,操作码为"Call"的偏移量为"0xBF"的指令时遇到错误

"An error occurred while calculating code metrics for target file  <file path>  in project <project name>. An error was encountered while parsing IL for method: '<method>', instruction at offset '0xBF' with opcode 'Call'"

尖括号内的文字为释义,为清楚起见.

Text inside the angle brackets are paraphrasing the details for clarity.

该项目(c#中的Windows Universal App,它是解决方案中的唯一项目,如果有关系的话),可以编译而不会出现错误或警告,并且可以在调试中运行.

The project (Windows Universal App in c# and is the only project in solution, if it matters) compiles without errors or warnings and runs in debug.

引用的方法存在并在代码中调用.

The referenced method exists and is called in code.

如果我注释了该方法及其所有调用,则指标计算有效.

If I comment-out the method and all calls to it, metric calculations works.

该方法虽然不美观,但却非常简单.

The method is no beauty, but it is pretty straightforward.

有什么想法吗?

P.S .:我怀疑这很重要,但这是打破指标的方法:

P.S.: I doubt it matters, but here is the method that breaks the metrics:

MyPoint<int> FindCellFromPoint( Point point ) { // calculate the offscreen Cell surrounding a point // this is a terrible algorithm for something that should be (reasonably) simple algebra but the variable cell shapes add enough complexity // that brute force will have to do. Alternatively, when I have time, write an algorithm for each cell shape individually MyPoint<int> guess = new MyPoint<int>((int)Math.Floor((point.X - board.Cells[0].Bounds.X) / (board.CellRadius * board.CellShape.ColumnWidth)), (int)Math.Floor((point.Y - board.Cells[0].Bounds.Y) / (board.CellRadius * board.CellShape.RowHeight))); MyPoint<int> closestCell = new MyPoint<int>(0,0); double bestVariance = double.MaxValue; Vector2 targetPoint = point.ToVector2(); for (int i = 0; i < 4; ++i) { for (int j = 0; j < 4; ++j) { Vector2 test = board.CellShape.CalcBaseVector(guess.X + i, guess.Y + j, (guess.X + i) & 1, (guess.Y + j) & 1); test *= board.CellRadius; Vector2 delta = targetPoint - test; float l2 = delta.LengthSquared(); if (l2 < bestVariance) { bestVariance = l2; closestCell.X = guess.X + i; closestCell.Y = guess.Y + j; } } } return closestCell; }

推荐答案

您好,mglogan,

Hi mglogan,

与与PCL库相关的此连接报告是否相似?

Is it similar to this connect report which was related to the PCL Library?

https://connect.microsoft.com/VisualStudio/feedback/details /1446883/code-analysis-autofac-bug

要真正重现此问题,请与我们分享一个驱动器的简单示例吗?因此,我们可以使用与您相同的环境来真正下载并调试它.还请告诉我您使用的是真正的VS2015版本.

To really repro this issue, would you please share us a simple sample using one drive? So we could really download and debug it in our side using the same Environment as yours. Please also tell me the real VS2015 version you use.

最好的问候,

Jack


这篇关于VS 2015计算代码指标失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆