Not getting any results - The main branch has no lines of code

  • ALM used - Bitbucket Cloud
  • CI system used - Bitbucket Cloud
  • Scanner command used when applicable:

script:
- pipe: sonarsource/sonarcloud-scan:1.2.0
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4

  • Languages of the repository - monorepo but these files are typescript
  • Error observed:

The main branch has no lines of code.

Quality gate has not been computed for project.

  • Steps to reproduce: Running any scan pipeline, it finishes successfully but when I click the task report I get the branch has no code, running the quality gate pipe fails saying the quality gate has not been computed.

Example task id: AXewAeidEWiiWykwLLk_

Hello @Matt12, welcome to the community forum and apologies for the late reply.

The error message the main branch has no lines of code indicates that your default branch hasn’t been analyzed yet. Could it be that you currently are only analyzing PRs and non default branches?

It would also be good to check that the default branch on SonarCloud is the same as on Bitbucket Cloud. You can do this by navigating to you
project on SonarCloud and Administration > Branches & Pull Request. You can rename the default branch on SonarCloud to match your default branch on Bitbucket Cloud.

1 Like

Same Error “The main branch has no lines of code.” when I scan my xcode project with Fastlane. Please help and if possible provide a well define tutorial how we scan iOS code with sonar through Fastlane.