Sonarqube reporting old code smells as new

I am using:
Sonarqube server: Enterprise Edition Version 9.9 (build 65466)
SonarScanner: dotnet-sonarscanner 5.13.1

I analyze 3 projects like below:
build.bat has just a list of 2 projects build commands:

Add the MSBuild commands to the file

msbuild ./path/to/project.vcxproj /p:Configuration=StaticDebug_vs141 /p:Platform=x64 /t:Rebuild
msbuild ./path/to/solution1.sln /p:Configuration=Debug /p:Platform=x64 /t:Rebuild
dotnet sonarscanner begin /n:"name" /k:"key" /"${{ secrets.SONAR_HOST_URL }}"  /d:sonar.login="${{secrets.SONAR_TOKEN_NET_CPP_C }}" /"bw-output"
    build-wrapper-win-x86-64 --out-dir bw-output build.bat
    dotnet build ./path/to/solution2.sln /p:Configuration=WinDebug /p:Platform=x64 /t:Rebuild
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN_NET_CPP_C }}"

Not sure if this is a bug or I am doing something wrong but it does not seem to be intended functionality. Sonarqube is showing old code smells as new.

The code smells show up in lines of code that I changed to fix some bugs, but they are not new in the sense that these code smells were already there before I made my changes.

New code is set to be compared with main branch, and main branch is compared to 30 days before.

Thank you in advance!


The issues are being marked new because they’re on “new” (added or edited) lines. This is intended behavior, and the underlying assumption is that you would clean up any old problems in the code you’re working in.