Code and details of code coverage not showing in SonarCloud for .Net solution

瘦欲@ 提交于 2020-08-10 20:02:11

问题


I have issues seeing details of the code analysis in SonarCloud.

What I have working is a .Net Core application with Coverlet. I do see that the results are uploaded and the coverage shows. However, I don't get to see a dashboard, the tab 'code' doesn't show code and Measures doesn't give detailed information either.

My Github project is linked and as I can see, the results are uploaded. I wondered why I can't see the code and detailed coverage. I'm not familiar with .NET code and SonarQube was already installed at other projects, so I wondered if I am forgetting something. I get to see the results for both PR builds as for the specific branch.

So my question is how to see the details. Could it be that it only shows on the master branch once I have merged?

This is a .NET Core project. I have the same issue with a .NET Framework application.


回答1:


I cant see the specifier of your sonarqube target, but this looks like either a short living branch or a pull request analysis. Those quality gates are always representing the change to the target branch. hence that, you will see no coverage information, if there is nothing new to cover.

Add a dummy class, without tests, and check if this issue still persists. Or if i am wrong with my assumption that this is not a long living branch let me know.

As an example from an opensource project

  • Pull request analysis with just readme changes - https://sonarcloud.io/dashboard?id=junit-pioneer_junit-pioneer&pullRequest=224
  • Pull Request analysis with a code change and coverage - https://sonarcloud.io/dashboard?id=junit-pioneer_junit-pioneer&pullRequest=216


来源:https://stackoverflow.com/questions/61745826/code-and-details-of-code-coverage-not-showing-in-sonarcloud-for-net-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!