Only new code appearing on Sonarqube

I’m trying to make sonarqube “see” my go directory from gitlab. I’ve replaced my add_executables with gobuild and sonarqube detects the directory(the branch that I’m working on in the directory). However only new code appears and in the code tab I see no files.
Can anyone help with the issue?
Here is what sonarqube displays:


In my sonarqube log I get the following:



However it says 28 files indexed,9 analysed and Calculating CPD for 12 files

Hi,

Welcome to the community!

It looks like you’re looking at a merge request rather than a branch. Is that correct?

 
Ann

Hi Ann,
Thank you for your response!
I did a merge request for my new branch but this shows up everytime I select my new branch in sonarqube
I just saw that after the logs I shared above I get a SonarQube Analysis result is null!
Howevere I don’t know how to fix it.
Thank you

Hi,

How about a screenshot that includes the top-left of the screen? In particular, I’m wondering what symbol shows up next to the branch name. E.G.:
Selection_999(464)

 
Ann

Hi Ann,
sorry for my delayed response its exactly like yours.
image

Hi,

What version of SonarQube are you on? That “From master” looks a little odd to me. Could this be a short-lived branch? If so, you won’t see Overall values there since SLBs focus only on new code.

 
Ann

Hello again,

It’s a default one for all our repos in gitlab I think it’s this one -Dsonar.projectVersion="1.7.0-sonarqube-SNAPSHOT. I created the branch to make sonarqube “see” my repository since it didn’t recognize it at all.I replaced my add executables with go build and thats what sonarqube displays now. The weird part is that in the code section it doesnt show any code which makes me assume that something didn’t go well. I still haven’t figured out what it is though

Hi,

What version of SonarQube are you running? You’ll find the version number in the SonarQube page footer.

 
Ann

Hello,
It’s Version 7.9.4

Hi,

SonarQube 7.9.* still has short-lived branches and I believe that’s what you’re looking at. Does your analysis command or analysis properties include the sonar.branch.target parameter?

 
Ann

Hello,
Yes it has the -Dsonar.branch.target=“master” .Does this mean it only analyses the master or that it has to have more changes in the code in order for it to detect it? because in the code folder it doesn’t include any code and I’m a bit confused.In another repository that had more changes in the branch we created to make sonarqube “see” our repo, sonarqube detects all the files and directories inside the repo so I’m trying to figure out whats happening here.

Hi,

That means you’re doing a Short-Lived Branch analysis and thus it’s natural and expected that you only see new code values.

What has been changed in your branch? If your branch consists only of deletions or of non-code changes (e.g. dates in copyright comments) then this is normal, IIRC.

 
Ann