Sonar analysis results are not same with same branches on multiple sonarqube servers

I’ve 2 sonarqube servers with 8.9 version and created using docker. but problem is i’m using the same branches and triggering mvn sonar:sonar with scm.sensor=true but results are not same.
NOTE: we are using specific baseline option with master branch sonar analysis on company sonarqube and in the local too.

  1. one sonarqube used by all the developers which is organisation level and one sonarqube is in their local. in first sonarqube server builds are keep on happening on daily basis by multiple developers. but in the local setup developer triggering sonar analysis but quality gate results are not matching on company sonarqube and local sonarqube when developers uses same branch on both the setup.

And giving same results when sonar analysis triggers same manner on new projects. ex : sonar analysis trigger on local with feature1 and same branch on company sonar. 2nd time: trigger sonar with feature 2 and same on company sonar and so on in the order…if any triggers happens other branches on company sonar later developer trigger with his own feature branch on local and company sonar since the flows is missed because there are other builds happened on sonar turvo by other developers then results are not matching with local. please tell me what im missing

Hey there.

What are some of the differences?

  1. % difference of code coverage
  2. % duplicates on new lines
    majorly above 2 points are not same as company sonar results with local sonar on same branches with same baselines

And we also observed, though we set the baseline as master but it still considering the previous build for sonar analysis. I mean master is the baseline, then after we are triggering sonar analysis on develop(giving so results)then triggering feature branch then again triggering develop branch, but quality gate results are not same as previous develop branch and current develop branch even there are no code changes during the analysis.

Hey there.

Any setup with multiple SonarQube instances is going to get messy pretty quickly, with a different version of the main branch being analyzed and different new code periods.

What we recommend is a single, central SonarQube instance, and branch analysis (available in Developer Edition and higher) where developers can submit their own branches for analysis. This also means consistent Quality Profiles, Quality Gates, and other project settings (like inclusions/exclusions).

please respond

Hey there.

This is a community forum, not a service desk. Please be patient and polite, instead of bumping threads.

That’s fine, is there any api’s to set the baseline using sonar property through command line. i found few of the api’s create,delete…etc but not found for set the baseline. it making us to manually set the baseline like project settings->new code-> select specific analysis branch.

I think you’ll find this guide useful: