Sonnar reports issues some days after code is merge to the main branch

Hello, we are working with SonarCloud normally with 0 issues. We use sonar.sources in order to run sonar just in specific folders (modules).

We noticed that sonar reports issues even days after the code was merged to the main branch

We need to have that issues reported in the dev branch in order to compel devs to fix that for a success pipeline.

We already try some properties but nothing report all the issues in dev branch
sonar.branch.name
sonar.scm.forceReloadAll=true
sonar.newCode.referenceBranch

Any idea how we can deal this problem?

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

As I understand it, the concern here is that new issues are raised after a 0-issues PR was merged?

Unfortunately, that’s a known issue. PR analysis only raises issues on the lines changed in the PR. If a change in the PR leads to new issues in untouched code, then this issues-after-merge problem is a natural consequence.

As a side note, you really don’t want to run with sonar.scm.forceReloadAll. All it’s doing in this case is increasing your analysis duration.

 
HTH,
Ann