简体   繁体   English

使用声纳的C#代码

[英]C# code using sonar

I am using .net framework 4.6.2 and visual studio 2015.I have written sample c# project and tried analyzing with sonar, I am able to run sonarqube successfully but after that in sonar server the result is empty. 我正在使用.net Framework 4.6.2和Visual Studio 2015.我编写了示例c#项目并尝试使用声纳进行分析,我能够成功运行声纳,但是在声纳服务器中之后结果为空。 find below detail description of what I have done: 在下面找到我所做的详细描述:

  1. Downloaded and installed sonarqube and kept in 下载并安装声纳并保存在
    C:\\Softwares\\sonarqube-6.7.4 C:\\ Softwares \\ sonarqube-6.7.4
  2. Downloaded and installed scanner , 下载并安装了扫描仪,
    C:\\Softwares\\sonar-scanner-cli-3.2.0 C:\\ Softwares \\ sonar-scanner-cli-3.2.0
  3. Added the path variable value in Environment variable as :C:\\Softwares\\sonar-scanner-cli-3.2.0\\bin 在环境变量中将路径变量值添加为:C:\\ Softwares \\ sonar-scanner-cli-3.2.0 \\ bin
  4. Then run the start sonar command 然后运行启动声纳命令
    from:C:\\Softwares\\sonarqube-6.7.4\\bin\\windows-x86-64 which shows 来自:C:\\ Softwares \\ sonarqube-6.7.4 \\ bin \\ windows-x86-64
    process is up, SonarQube is up . 进程启动,SonarQube启动。
  5. My sample solution path is : 我的示例解决方案路径是:
    C:\\Softwares\\c# sample\\sample Also added sonar-project file in the C:\\ Softwares \\ c#sample \\ sample还在声纳项目文件中添加了
    same path which contains project details such as path, key ,port, 包含项目详细信息的相同路径,例如路径,键,端口,
    version, language. 版本,语言。
  6. In the cmd window reach out to the solution path and hit sonar-scanner command 在cmd窗口中,到达解决方案路径,然后按声纳扫描仪命令

which shows Execution Success after checking http://localhost:9000/projects?sort=-analysis_date shows zero bugs,zero Vulnerabilities and 0 code smells with passed solution name. 它在检查http:// localhost:9000 / projects?sort = -analysis_date后显示执行成功,显示零错误,零漏洞和0带有已传递解决方案名称的代码味道。

Can someone have an idea what is wrong or missing in this ? 有人可以知道这是什么错误或遗漏吗? adding the screenshot of cmd prompt 添加cmd提示的屏幕截图

sonar-qube sonar scanner 声纳Qube 声纳扫描仪

Thanks, 谢谢,

You need to use the Scanner for MSBuild to analyze C# (or VB.NET), not the Scanner CLI. 您需要使用Scanner for MSBuild来分析C#(或VB.NET),而不是Scanner CLI。 The documentation is here . 文档在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM