However since even in my example it is not clear where is the issue and I admit that I could have screwed up somewhere while hacking the conditions to reproduce the bug, I created a ticket to improve this behavior. SONAR-24333
Meanwhile if you could try to reproduce this bug on the latest Community Build (specifically the fact that issue appears on top of the file instead of the correct line) it would be helpful to know that this behavior was not fixed by some side effect.
Anyway my team will take a look at this issue when we’ll have time for it.
Thank you very much for the repro, thats awesome! It actually made it clear to me that there is another issue on how dotnet sonarscanner works. Basically when the issue has startcolumn == endcolumn and startline == endline this information is not populated when the data comes to Frontend.
So to sum up there are 2 problems:
Frontend is not doing the best job on handling startcolumn==endcolumn cases (it looks like it highlighting the whole line - see my screenshot). My squad will handle this issue and you can check the ticket I share for tracking if you want.
It seems like dotnet-sonarscanner ignores region field of Issues.json if startColumn==endColumn. I will ping the squad that owns this part and let them fix that issue.
I would like to appreciate again the time you spent on creating the reproducer, I am pretty sure that I would not notice the second issue without your repro.
@jwfx, for issue 1 - yes,
For issue 2 we still need to dig a bit deeper to understand what exact component is ignoring this information in the following chain: scanner → analysis processing → endpoint to get the issues, once we discover the exact component that causing it we will create a ticket and assign it to the correct team and update this thread with a link to created ticket.
First, I would like to thank you for providing a full reproducer! That was very helpful!
I was able to pin down the issue, and it is coming from the C# Analyzer plugin.
We consider any issues with the start location and end location being same as a file level issue.
I have created a ticket in our backlog.
Unfortunately, I cannot share it with you as our backlog is private at the moment.
Please note, that we needed to fix the location and make it one character wide. If we do not do this, the whole line is underlined. Because we don’t know the length of the line, we opted for expanding the location one character to the left if possible and only for the first column we expand to the right. The leads to a small problem in the UI. See the PR for more details.
It would be nice if the UI could handle zero length positions, so we could remove that workaround.