Empty Analysis on Feature Branches

We are running our analysis from CircleCi.

Report is giving 0 bugs when run from feature or PR.

When we merge to branch, we are getting a list of bugs in report.

How can we force a full analysis on feature branch?

To Add more info:

  • Long Lived branch has a lot of bugs.
  • We checkout from that long lived, no new code is added.
  • Analysis of feature branch (short lived) shows 0 bugs. Shouldn’t inherit from the long lived branch we checked it our from?

Thanks

Consider this scenario:

  1. you branch off form develop -> feature/X
  2. you add your new code
  3. when you do the analysis, you do with sonar.branch.name=feature/X and sonar.branch.target=develop?
  4. if yes, then if you have 0 bug on the analysis, and you merge it, does the develop branch has bugs/issues on the new code you’ve added?

But that is not my scenario.
My master branch has “xx” bugs.
I am branching of it and trying to work on these bugs. But whenever I push or run analysis, Sonar will not show me the history from the master branch. Only for new code.
How am I supposed to keep the history :slight_smile:

I think i see what you mean, but i don’t think sonar works that way. So the logic for a short branch is that it has some differences against the master branch. there is no point to hold that much data duplicated. So basically you look on the master branch, try to solve the errors, and as long as you do sonar analysis on your feature branch, everything is ok, and when you merge your branch and do an analysis on master branch, the bugs (or some of them ,the ones you worked on) should be fixed

Hi,

We believe in a concept called fix the leak, and therefore we only show issues introduced into newly added/edited code in your short-living branches. The idea is that over time you will fix your codebase by making sure that the newly added/edited code is of a high standard.

In your case I would recommend making the branch that you use to fix the issues long-living as well. This will show all the issues that exist in the branch on every analysis. See the Long-lived Branches page in the documentation.

On your project, go to Administration / Branches & Pull Requests . There, you will see in the top-right corner a text like this: "Long living branches pattern: (branch|release)-.* ". That means that when the name of the branch starts with branch- or release- , then it will be considered a long-living branch.

1 Like