Misevaluate the new code if current source has been rebased

Must-share information (formatted with Markdown):

  • which versions are you using:
    • SonarQube Server: v9.9
    • SonarQube Scanner: v4.7.0.2747
  • how is SonarQube deployed: Docker (compose)
  • what are you trying to achieve: static analysis for each commit (scanner will be triggered by CI pipeline)
  • what have you tried so far to achieve this:
    Our development team use web API to specify the new code base (code analysis) when the main branch of our project has a new commits. In this way, we can always compare the new code coverage of new branch with main. But the problem is: We noticed that if the new branch has been rebased before it be merged to main, then SonarQube will misevaluate the new code. And we also found that if we create the new branch from main branch and apply the git patch to it, the new code would be correct.

Hey there.

I want to make sure I understand – which New Code Period are you choosing in this case?