Files being incorrectly identifed as "new"

Using version: 8.1.0.31237, I am getting failed pull request builds and occasionally failed main branch builds because SonarQube thinks some files are new. My quality gate is set to only identify issues on new code.

The pull request contains one file, and yet the pull request analysis shows 49 files, all altered 15 hours ago (or whatever), and yet those files weren’t changed. What is marking them as new?

I am also having an issue where SonarQube misses out thousands of lines of code every now and again, which creates real issues. In fact, that’s what be leading to these “new” files. I’ve added a screenshot which shows the issue.

Any assistance is appreciated.

Kind regards,

Mike Kingscott

I’m using the standard C# scanner, with a modified ruleset.

Hi Mike,

This sounds suspiciously like a “helpful” process normalizing whitespace in the background during checkin. At least, that’s what we’ve seen in similar cases.

SonarQube can only report on the data that’s fed to it. I would look to your CI process here and compare the job logs for runs with and without “missing” code.

 
HTH,
Ann

1 Like