We have recently our SonarQube task version to 5 in our Azure DevOps, since then most of our API’s aren’t failing in the sonar analysis task, but show ‘failed’ state in the project level, if that is a real issue it should get in the sonar task only.
Issue 1: why aren’t the issues reported in the sonar analysis task itself?
showing incorrect results in the task or in the project I guess. This is quite interesting, I haven’t faced this anywhere before. what might be the cause?
Issue 2: Also, we are getting code smell in the test files as “Add at least one assertion to this test case”
I had a chance to look similar topics on this, which is FP or FN. I don’t really understand why this started occurring all of a sudden (I’m from DevOps background)
Drop a comment, if anyone had faced this before or any ideas.
Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:
But when I check the same project in the sonar UI, it shows as failed state (with major issues where it is reported as warning in the pipeline task)
reference: attached image
I think there’s just a little misunderstanding here of how the analysis works.
The SonarScanner for .NET attaches Sonar roslyn analyzers to the build, which will raise warnings during the build because that’s… how they work. They are the issues that are ultimately put into a report and sent off to SonarQube. You shouldn’t expect them to fail your build.
SonarQube will then report on those issues (and assign a severity based on your Quality Profile) that and compute a Quality Gate. You can choose to have this fail your build by using the sonar.qualitygate.wait analysis parameter, but it’s not required.