声纳的FxCop结果不显示 [英] sonar fxcop results not displayed

查看:340
本文介绍了声纳的FxCop结果不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用声纳一些ASP.Net应用程序。
我已经安装了声纳和配置C#的环境中,我得到这个工作...除了FxCop的(code分析)。

I'm trying to use Sonar on some ASP.Net applications. I have installed Sonar and configured C# environment, and I get this working...except for FXcop (Code Analysis).

我跟着<一个href=\"http://docs.$c$chaus.org/display/SONAR/FxCop,+Gendarme+and+StyleCop#FxCop,GendarmeandStyleCop-FAQ\"相对=nofollow>官方文档:


  • 声纳runner.bat是确定

  • 的FxCop路径配置好

  • 蔡司镜头亚军推出的FxCop(12.0)正确

  • 的FxCop建立项目
  • 的.sonar目录的FxCop-report.xml将
  • 此文件包含一些问题,我应该在Sonarqube看到

  • 的FxCop出口1024 code,至极似乎确定了声纳亚军

  • 声纳亚军的执行似乎要被罚款一向:分析成功的......然后,执行力SUCCESS

  • sonar-runner.bat is ok
  • FXCop path is well configured
  • Sonnar-runner launches FXcop (12.0) correctly
  • FXCop builds the "fxcop-report.xml" in the .sonar directory of the project
  • This file contains some "issues" that I should see in Sonarqube
  • FXCop exit with 1024 code, wich seems ok for sonar-runner
  • sonar-runner execution seems to be fine all along : "ANALYSIS SUCCESSFUL"... Then "EXECUTION SUCCESS"

我的默认画质规则是唯一的那些的FxCop

My default Quality rules are "only" the FXCop ones.

但是,当我连接到sonarqube,我为我的项目为0的默认值。
我的意思是,我真的希望有0默认值,但这并不现实。

But when I'm connecting to sonarqube, I have "0" defaults for my projects. I mean, I would really want to have 0 defaults, but this is not the reality.

我一直在寻找人很多,我已经看到了一个官方论坛说,在问题的报告元素属性得到它的工作应该有路,文件,我在这种情况下,

I've been searching al lot, and I've seen on an official forum saying that the issues elements in the reports should have "path" and "file" attributes to get it working, and I'm in that case :

<Member Name="#TypeDeclar()" Kind="Method" Static="False" Accessibility="Private" ExternallyVisible="False">
       <Messages>
        <Message TypeName="Dispose objects before losing scope" Category="Microsoft.Reliability" CheckId="CA2000" Status="Active" Created="2015-01-19 13:37:17Z" FixCategory="DependsOnFix" BreaksBuild="True">
         <Issue Name="ExceptionEdge" Certainty="75" Level="Warning" Path="c:\Projects\ProjectA" File="WebEdition.ascx.cs" Line="71">In method 'WebEdition.TypeDeclar()', object 'sqlcmd' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'sqlcmd' before all references to it are out of scope.</Issue>
         <Issue Name="ExceptionEdge" Certainty="75" Level="Warning" Path="c:\Projects\ProjectA" File="WebEdition.ascx.cs" Line="69">In method 'WebEdition.TypeDeclar()', object 'sqlconn' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'sqlconn' before all references to it are out of scope.</Issue>
        </Message>
        <Message TypeName="Do not dispose objects multiple times" Category="Microsoft.Usage" CheckId="CA2202" Status="Active" Created="2015-01-19 13:37:17Z" FixCategory="DependsOnFix" BreaksBuild="True">
         <Issue Certainty="75" Level="Warning" Path="c:\Projects\ProjectA" File="WebEdition.ascx.cs" Line="92">Object 'sqlconn' can be disposed more than once in method 'WebEdition.TypeDeclar()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 92</Issue>
        </Message>
       </Messages>

希望有人通知我成才!怀念
谢谢你。

Hope someone notice someting I miss !!! Thanks.

推荐答案

我终于找到了问题:那是因为我的服务器,我在那里执行声纳我的code源的绝对路径,是不是等于我的一个开发计算机上:

I finally found the issue : it was because the absolute path of my code source on my server, where I execute Sonar, was not equal to the one on my development computer :

开发计算机

C:\\项目\\项目A ....

C:\Projects\ProjectA....

服务器:

C:\\ ContinuousIntegration \\ DOTNET \\项目\\项目A ....

C:\ContinuousIntegration\Dotnet\Projects\ProjectA....

声纳无法找到这些文件,因为它一直在寻找的开发绝对路径。

Sonar was unable to find the files, because it was looking for with the "dev" absolute path.

我已经看到了这个执行声纳亚军-X,并读取所有的日志...

I've seen this executing "sonar-runner -X", and reading all the log...

希望它可以帮助别人;)

Hope it will helps someone ;)

这篇关于声纳的FxCop结果不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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