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:
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
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.
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
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?
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.
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.