We’re using SonarQube Developer Edition v2026.4.1 (126914).
We use the Reference branch New Code definition, pointed at a branch fixed to the beginning of the year, so “new code” = everything changed since then.
Over the year we moved the source directory of several Java modules from src to src/main/java. Each move is a single commit containing a paired delete (old path) + add (new path) — a clean rename with no content changes.
Git itself detects these as clean renames (visible via git log --follow, or blame with rename/copy detection), but SonarQube does not recognize the move — it treats the moved files entirely as new code. Since none of that new code has fresh test coverage attached, our New Code Coverage metric for those modules drops sharply — even though not a single line actually changed.
Questions
- Is there a supported way to make the New Code calculation recognize a same-commit delete+add of identical content as a move, instead of counting it as new code?
- Is this a known limitation?
- Any recommended workarounds for large-scale directory restructurings mid-year that others have used successfully?
Any pointers or war stories appreciated, this is currently blocking accurate coverage tracking for the modules we’ve already moved.