Hello Team,
I am noticing an issue with SonarQube’s New Code detection when scanning an updated HTML file.
I added the following new block in my HTML file:
<section class="card">
<h2>Horses__c</h2>
<p>Full CRUD permissions.</p>
</section>
Horses__c
Full CRUD permissions.
This block was added between lines 71–74 in my editor.
However, after triggering a scan in SonarQube, the New Code highlight appears between lines 72–75 instead.
You can refer to the attached screenshots:
Screenshot 1: Editor showing the actual new code added at lines 71–74
Screenshot 2: SonarQube UI showing the New Code block highlighted at lines 72–75
This indicates a 1-line shift between the actual new code and SonarQube’s calculated new code.
Questions / Request for Clarification
Is this behavior expected in SonarQube?
Does SonarQube internally normalize line endings, whitespace, or HTML formatting that could cause a line shift?
Is there any configuration or setting we can adjust (e.g., SCM) to ensure SonarQube matches the exact line numbers from the source file?
If this is not expected, could you please confirm if this is a known issue or provide guidance on how to correct this behavior?
Environment Details
SonarQube Edition: Community
SonarQube Version: v25.5.0.107428
Scanner: SonarScanner
File type: .html
Lines involved: Editor (71–74) vs SonarQube (72–75)
Please let me know if you need the file itself or the full diff to investigate further.
Looking forward to your clarification.
Thank you!


