New code detection Community version


In our projects (.NET 4.7) on Gitlab CI, we use sonar-scanner-msbuild (v5.13.0.66756) to scan the quality of our projects.

We are currently viewing the results on Sonarqube Community (v9.9.1.69595).

For the past few months, we have been using the new code quality gate functionality based on the previous version. However, in recent weeks, we have noticed that the detection of new code is no longer functional.

Here is our code:

SonarScanner.MSBuild.exe begin /k:“${CI_PROJECT_NAME}” /“https://…” /d:sonar.login=“${sonarqube_token}” /d:sonar.qualitygate.wait=true /d:sonar.cs.opencover.reportsPaths=“CoverageReport.xml” /d:sonar.cs.vstest.reportsPaths=“/TestResults/*.trx” /v:“${CI_COMMIT_SHORT_SHA}”

SonarScanner.MSBuild.exe end /d:sonar.login=“${sonarqube_token}”


Best Regards,

Hey there.

I guess you’re referring to the fact that you have two analyses, one with 25447 Lines of Code and another with 25535 Lines of Code, but there’s no sign of this in your project dashboard.

I agree that’s confusing, but I’d like to mention that Lines of Code isn’t the measure being displayed by any of these “zeroes”.

Can you chart “Lines to Cover” and “Lines” and see if there’s also a difference, or if the numbers are stable?

Hello Colin,

Thank you about your message !

Here’s the charts :

There’s also a difference with “Lines to Cover” and “Lines” metrics.

In this screen, we can see a difference between “New code Period starts here” in the left pannel and “new code” in the charts

What could explain a difference between the Lines figure but no new lines indicated on the project dashboard?

Hi Florian,

I believe that we simply display “0 new lines to cover” when the main metric is not computed. In other words, because there is no coverage information, we don’t display the actual number of lines to cover.
The same goes for duplication.

That is confusing, so we’ve created a ticket to improve it.

Thanks for reporting this!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.