New Code not being detected

I am setting up Sonarqube Community Edition Version 9.9 (build 65466) on a virtual machine to analyze the code. I have the code on main branch in a github repo, while previous releases are maintained in a different branch. I have created a new project and run the analysis on the release branch, assigning it a version and setting that as the New Code baseline using the “Specific analysis” option. I am now running the analysis on the main branch and expect to see the issues introduced in the new code since the release. However, Sonarqube does not seem to be able to recognize the new code correctly. It just says 0 lines of new code. Is my idea of setting up Sonarqube in this way and analyze code since the release correct?

To confuse things even more, I also have a local (embedded DB) version of Sonarqube running. When I did the same thing locally, it actually showed me the new code correctly.

What do I need to do to set it up correctly? Thanks.

I want to add that the new code is being processed and any issues introduced are also being shown in the Issues tab. The problem is that these are not being categorized as new code or issues in new code.

If it helps, I am running the analysis locally (not connected Sonarqube to Github). So I change the branch to release/main, pull the latest code, and then run the analysis. Since Sonarqube is running locally on the codebase, I imagine the branch should not matter, right?

I’ve added this info as I came across some links about Sonarqube Community edition only supporting analysis for main branch.