StyleCopAnalyzers (C#) rule SA1629 leads to "not a valid line offset for pointer" and breaks import of scan results

Hi,

we are using SonarQube with a StyleCop.Analyzers plugin (which we build using the SonarQube Roslyn SDK).
We are currently on the previous LTS (6.7.3) and I’d like to update to the latest LTS (7.9). However, with 7.9 our build job breaks with an ERROR
ERROR: Error during SonarQube Scanner execution
ERROR: 43 is not a valid line offset for pointer. File Collections/IStatisticHeap.cs has 42 character(s) at line 72

I think I know what causes the problem:
One of our active rules is SA1629: “Documentation text should end with period”.
This diagnostic reports on the place where the missing period should be. In Visual Studio it looks like this (note that the squiggly line appears right next to the last character of that line:
2019-07-15%20VisualStudio_SA1629

Apparently SonarQube 7.9. can’t handle this and instead reports an error that something was found at a location that does not exist.
For comparison, in SonarQube 6.7.3 such finding could be imported and were displayed like this:
2019-07-15%20SonarQube_SA1629

Please advice.

Thanks,
Markus

2 Likes

FYI looks to be the same as sonar-dotnet issue #2192 that was fixed in v7.10 of the SonarC# plugin.

The LTS ships with SonarC# v7.15 so it looks like a regression, unless you’ve manually downgraded your version of SonarC#.

Thanks for the quick response. I did not downgrade SonarC#. The SonarQube instance with which I’m testing is using SonarC# 7.15 (build 8572).
Should I report this issue on GitHub?

Yes please. Thank you!

Issue created: #2484 Roslyn external issues can contain invalid locations (again)

3 Likes