Can anyone point to why SonarCloud isn't picking up any lines of code?

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
    Github
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
    Harness
  • Scanner command used when applicable (private details masked)
sonar-scanner 
    -X 
    -Dsonar.host.url=https://sonarcloud.io 
    -Dsonar.pullrequest.base=<+codebase.targetBranch> 
    -Dsonar.pullrequest.branch=<+codebase.sourceBranch> 
    -Dsonar.pullrequest.key=<+codebase.prNumber>
  • Languages of the repository
    80% Python, 20% TypeScript
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

there are no lines of code being picked up

from the Debug output I see SCM reported changed lines for 0 files in the branch

18:51:17.554 DEBUG: file=/harness/.git/objects/pack, is unmodified
18:51:17.554 DEBUG: Merge base sha1: 2d29fd9f0c590b0b10d4d4c509dae5363dbd8ed0
18:51:17.554 DEBUG: SCM reported changed lines for 0 files in the branch
18:51:17.554 INFO: SCM writing changed lines (done) | time=23ms
18:51:17.557 DEBUG: Could not detect the dotnet / msbuild version
18:51:17.640 INFO: Analysis report generated in 167ms, dir size=3 MB
18:51:18.750 INFO: Analysis report compressed in 1110ms, zip size=2 MB
18:51:18.750 INFO: Analysis report generated in /harness/.scannerwork/scanner-report
18:51:18.750 DEBUG: Upload report
18:51:27.080 DEBUG: POST 200 https://sonarcloud.io/api/ce/submit?organization=teamlumos&projectKey=teamlumos_lumos&characteristic=pullRequest%3D13689 | time=8329ms
18:51:27.085 INFO: Analysis report uploaded in 8335ms
18:51:27.086 DEBUG: Report metadata written to /harness/.scannerwork/report-task.txt
18:51:27.086 INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=teamlumos_lumos&pullRequest=13689
18:51:27.086 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
18:51:27.086 INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AYwSHz-VJleZxK6AslRa
18:51:27.088 DEBUG: Post-jobs : 
18:51:27.091 DEBUG: Shutting down the bridge server
18:51:27.104 DEBUG: The worker thread exited with code 1
18:51:32.094 DEBUG: The bridge server shut down
18:51:32.417 INFO: Analysis total time: 1:51.905 s
18:51:32.420 INFO: ------------------------------------------------------------------------
18:51:32.420 INFO: EXECUTION SUCCESS
18:51:32.420 INFO: ------------------------------------------------------------------------
18:51:32.421 INFO: Total time: 1:55.166s
18:51:32.524 INFO: Final Memory: 229M/840M
18:51:32.525 INFO: ------------------------------------------------------------------------

however, in SonarCloud I do see there’s an analysis for our main branch dev, so not sure why there’s 0 lines of code

  • Steps to reproduce
  • Potential workaround

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

Harness rings a bell. Can you take a look at this thread?

1 Like