C#: S125 False positive when comment line ends in semicolon

SonarLint (I suspect this is present in all versions)

// this will repro;

The false positive is obviously that the comment is just a comment, it’s not commented code.

Thanks @VladIonut and sorry for the late reply.

Indeed, our heuristic is not really perfect, and your repro is part of our unit tests - if we see a semicolon as the last character in the line, we consider it a line of code…