New issues on old code in short-lived branch

Hi Duarte

Yes we are using git. I do a git fetch origin master:master and so the master branch is up-to-date.

No, the line of code in question is NOT yellow. So I assume it is NOT considered New. But Sonar tells me there is an issue with the line nonetheless.

Regarding all the lines that are yellow: I see some yellow blocks of code that are from 1 year ago - I’m not sure why they are yellow and considered to be new. That seems odd to me.

The master branch is 6 years old and the integration branch is 5 years old. When the integration branch is an SLB, I see changes dating back 5 years. Under the twistie “Creation date” it defaults to All code. If I set it to New Code then I have to change the date range (or course) via the little bar chart to tell it what date range New Code is. So it makes sense to me that it is looking at the whole lifespan of the SLB. The SLB branch is 5 years old remember and we are using an old SonarQube, namely version 7.9.1

So it feels like Sonar is working as I described. Furthermore, I read the following from your colleague G Ann Campbell (@ganncamp) which backs up what I said about the analysis being for “what has changed since the branch was … branched off of the main branch”:

See The last analysis has failed - #8 by ganncamp

“What you’ve shown is a Short-lived branch (SLB). The assumption is that all that matters to you is analysis of what has changed since the branch was … branched off of the main branch.”

AND

“BTW SLBs and PRs don’t show delta from the last scan of master, but from their branch points

Up to now my experiments back up what G Ann Campbell (@ganncamp) says, but I am still checking things in this respect.

Please could you confer and clarify what Sonar 7.9.1 is actually doing?

Thanks in advance.