We had similar issues ('New Code' on feature branch being polluted with details from mainline).
One of the things that helped us get past this issue is to use pullRequest information when doing the sonar-scan. I cannot deeply explain it, but telling the scan to use PR info rather than straight up branch-comparison radically improved the ability for sonar to correctly calculate the ‘new code’