SonarCloud branch has no lines of code - bitbucket pipelines - sonarsource/sonarcloud-scan

Hi,

I am using bitbucket pipelines with docker container: sonarsource/sonarcloud-scan:0.1.5

I am specifying a branch: -Dsonar.branch.name=“xxx”

I am analysing .cs files in the .net core project

INFO: 11 files to be analyzed
INFO: 11/11 files analyzed
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 126ms, dir size=184 KB
INFO: Analysis report compressed in 22ms, zip size=40 KB
INFO: Analysis report uploaded in 285ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/dashboard?id=xxx&branch=release%2Fxxx
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=xxx
INFO: Analysis total time: 8.848 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 38.882s
INFO: Final Memory: 29M/128M
INFO: ------------------------------------------------------------------------

The branch pops up in sonarcloud. But on the overview tab it says “xxx” branch has no lines of code."
So there are no issues or meassures. But if I click on the Code tab I can see the 11 .cs files

Any idea what´s going on here?

hi @tyskland, could you please follow the steps described in Bitbucket Pipe + SonarCloud + C#/.net core and let us know if it answers your question.

Thanks @Andrei_Epure it worked like a charm. Needed the exact config.
Seems like you need
- apt-get install --yes --force-yes openjdk-8-jre
because sonarscanner end requires java

my pipeline didn´t require memory increase like below:

definitions:
  services:
    docker:
      memory: 3072 # increase memory for docker-in-docker from 1GB to 3GB
1 Like

Great to hear you made it work, @tyskland !