Performance Issue: SonarScanner Analysis step on ci takes too long

  • which versions are you using: SonarScanner 4.8.0.2856
  • how is SonarQube deployed: zip
  • what are you trying to achieve: to check javascript code for bugs, cleanliness, etc.

We have around 14k lines of code and I see that sonarcloud step runs ~ 1.5h each time SonarCloud step is execued. Previously it was about 10 mins. Not sure what happened.

11:10:01.828 INFO: Total time: 1:20:35.711s
11:10:02.075 INFO: Final Memory: 775M/1408M

My sonar step is pretty simple

sonarcloud:
    <<: *job-defaults
    steps:
      - attach_workspace:
          at: .
      - sonarqube/scan:
          cache_version: 2
          sonar_token_variable_name: SONAR_CLOUD_TOKEN
          sonar_additional_params: "-Dsonar.externalIssuesReportPaths=audit/sonar-dep-vulns.json -Dsonar.javascript.lcov.reportPaths=reports/test/coverage/lcov.info"

Hey there.

Do you have a tsconfig.json file in your project root?

We’re aware of an issue affecting our Javascript/Typescript analyzer that you can learn about here (as well as a workaround).

In principle, using the property sonar.typescript.tsconfigPath to point to the tsconfig.json in the project root should solve the issue.

And, a better fix should be deployed to SonarCloud soon.

no, we don’t have tsconfig.json in our project

Thanks. I suggest trying this workaround then:

1 Like