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)
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
  • Scanner command used when applicable (private details masked)
  • 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 | 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:
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
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: ------------------------------------------------------------------------
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