我可以在 Linux 上为 .NET Core (C#) 运行 SonarQube 代码分析吗?

编程入门 行业动态 更新时间:2024-10-12 01:27:32
本文介绍了我可以在 Linux 上为 .NET Core (C#) 运行 SonarQube 代码分析吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试针对 Linux 的 .NET Core 项目执行和报告 SonarQube 代码分析(目前没有测试覆盖)强> 构建代理.

我从

我想确保我的项目至少包含一个错误,所以我在其中一个源文件中添加了一个 goto 语句,并检查了我们的质量配置文件中是否启用了该警告,但是我仍然没有问题.(源文件本身被正确拾取,我可以在 SonarQube 中看到文件列表和所有源.)

我做错了什么,或者这不应该起作用?

(只是为了澄清,这不是关于 .NET Core 的现有问题的重复:我在此处显示的相同命令在 Windows 上对我有效,它仅在 Linux 上不起作用.)

解决方案

此问题现已修复,因此如果以这种方式运行,您应该会看到错误.

参见 github/SonarSource/sonar-csharp/issues/535

I'm trying to execute and report a SonarQube code analysis (without test coverage for now) against a .NET Core project from a Linux build agent.

I downloaded sonar-scanner from this page, and trying to run the report with the following command (the server url is set up in the configuration).

sonar-scanner -Dsonar.projectKey="MyProject" -Dsonar.projectName="MyProject" -Dsonar.sources=$PWD

The execution seems to be successful, I uploaded the full output to this gist.

However, if I go to the project dashboard on the SonarQube site, I don't see any issues or code smells whatsoever.

I wanted to make sure that my project contains at least one error, so I added a goto statement to one of the source files, and checked if that warning is enabled in our Quality Profile, but I still get no issue. (The sources files themselves are picked up correctly, I can see the list of files and all the source in SonarQube.)

Am I doing something wrong, or is this not expected to work?

(Just to clarify that this is not a duplicate of the existing question about .NET Core: the same command I showed here works for me on Windows, it only does not work on Linux.)

解决方案

This has now been fixed so you should see an error if run this way.

See github/SonarSource/sonar-csharp/issues/535

更多推荐

我可以在 Linux 上为 .NET Core (C#) 运行 SonarQube 代码分析吗?

本文发布于:2023-06-11 00:10:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/621957.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上为   代码   Linux   NET   SonarQube

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!