FxCop 的奇怪警告计数行为?
我的团队正在使用 FxCop 来帮助清理现有的 ASP.NET 应用程序。
我们注意到 FxCop 计算警告的方式存在一些奇怪的行为。
似乎在一次通过代码时,FxCop 只查找并计算与每个方法中的特定规则相关的第一个警告。
因此,如果我有:
public test3(){
int a = 0; //DoNotInitializeUnecessarily
int b = 0; //DoNotInitializeUnecessarily
}
...我的 FxCop 报告将仅在方法 test3() 中查找并计数 DoNotInitializeUnecessarily 类型的第一个警告。 有什么方法可以让 FxCop 在方法 test3() 中找到并计算此问题的两个实例吗?
当前的计数方法对我们来说是有问题的,因为 FxCop 报告的警告数量较少。 这使得很难估计修复现有 FxCop 警告需要多少时间,因为我们实际上不知道应用程序中有多少个警告。
My team is using FxCop to help clean up an existing ASP.NET application.
We have noticed some strange behavior in the way FxCop counts warnings.
It seems that on one pass through the code, FxCop only finds and counts the first warning related to a specific rule in each method.
So, if I have:
public test3(){
int a = 0; //DoNotInitializeUnecessarily
int b = 0; //DoNotInitializeUnecessarily
}
...my FxCop report will only find and count the first warning of type DoNotInitializeUnecessarily in method test3(). Is there any way to make FxCop find and count both instances of this problem in method test3()?
The current method of counting is problematic for us, because FxCop is under reporting the number of warnings. This makes it difficult to estimate how much time will be required to fix existing FxCop warnings, since we don't actually know how many are in the application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你尝试过改变吗
工具 -> 设置 -> 项目默认值 ->“在 [1] 异常后禁用规则”
?
Did you try changing
Tools->Settings->Project Defaults->"Disable rules after [ 1] exceptions"
?