We have SonarCloud up and running in our environment for 1 month now, and last week, we encountered with some code smells being detected while creating a PR into one of our longer branches (develop).
Our PR was raised on August 7th, and it was detecting code smells that were pushed on June 26th.
I checked other topics
and there are some suggestion of upgrading Sonar, but in our case, this is only being affected when PR decorations are executed.
We have the new code definition based on previous version.
What could be the cause of this new behavior, and how can we fix it?
ALM used AWS CodePipeline with Github Actions
Scanner command used when applicable (private details masked)
Languages of the repository: Python
Let me know if you need additional details.
Thank you.
Christian.
PR analysis isn’t actually based on the New Code Definition, but on what’s new in the PR. I suspect this is a problem with the SCM data available to analysis. What’s your fetch-depth when you check out?
Can you share your analysis log?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
I hadn’t noticed the second one, to be honest. But yes, reset them both. If analysis can’t automatically detect from your filesystem that you’re using Git, telling it that you’re using Git isn’t going to help.
To be honest, that second one is vestigial, and I have no idea why we haven’t removed it yet.