Incorrect Issue count in New Code

Sonar Scanner:
Sonar Version: Developer Edition
Deployment: Installed in EC2. Not a docker.
Integrated: AWS Code Pipeline
Invoking Type: Java - MVN Sonar:Sonar & ReactJS Sonar-Scanner command.
New Code Baseline: Branch

  1. The count shown in the new code screen is not matching with the list of issues when clicked the number.
  2. Issues are considered only from the latest commit. i.e. When scanned multiple times, previous issues are getting hidden from the new code section and the pipeline is passed without considering them.

Can someone help on how to address above issues. Let me know if further details needed.

Hey there.

Can you give an example? Screenshot(s) would be best.

This can happen if sonar.projectVersion is set to a new value on each analysis, and you have a New Code Period of Previous Version. Could this be happening in your project?

Thanks for the reply COlin, Attached screenshots for point 1.

For Point 2 - We are not depending on the Project Version, we are using branch as baseline for new code. Attaching screenshot for reference,

This looks like something that can happen when the Elasticsearch indices fall out of sync. Can you try following the process here?

  1. Stop SonarQube
  2. Delete the data/es8 directory
  3. Restart SonarQube

It says your last analysis has warnings. What are they? Is SonarBaseline a branch you have analyzed by SonarQube?

Hi Colin, Issue is still same even after deleting the data/es8 directory. Please refer below screenshots.

Below are the warnings


Warning are only in the backend/java app now… no warnings in the frontend/reactjs app.