- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- how is SonarQube deployed: zip, Docker, Helm
- what are you trying to achieve
Understand exaclty what :
- sonarqube analysis standard and sonarqube analysis pull request do
- which difference between them when we have set same “new code reference” branch.
So, we have standard and MR analysis configured like this :
New Code Reference is configured as specific branch ‘develop’
What we want is to solve sonar errors that appear after merge and not at comit/Mr analysis.
Several people had read all the doc releated to analysis or new code but it’s not clear, there is a lack of precise information.
Can you give some examples of issues that appear after merge that didn’t appear in the pull request?
There are some issues like
Reduce the number of conditional operators (5) used in the expression (maximum allowed 3)
This issue has not been detected at commit and merge request analysis but after merge on reference branch.
This issue is detected on all new branch created from this reference branch (after merge).
I can’t share it at this moment but i will.
However, we encounter another problem with commit sonar analysis and issue detection:
- we create a feature branch from reference branch pointed on commit(#A)
- we push a new commit(#B) on this feature branch
- Sonar detect some issue → it’s ok
- we push a new commit(#C) on this feature branch withtout solve these issues
- Sonar does not (re)detect issues from commit (#B) but only new issues introduced between commit(#B) and commit(#C).
Is it possible the issues are falling into the Overall Code tab, or are they gone from the Issues tab entirely?
yes these issues appear in overall code.
The problem is quality gate are computed according to new code.
It sounds like maybe your New Code Period is being updated every analysis to only include the changes from the last analysis. How is your new code definition defined for the project?
New code is defined as “reference branch”