SonarCloud Analysis Taking too long

Template for a good new topic, formatted with Markdown:

  • ALM used: GitHub
  • CI: CircleCI
  • Scanner command used: - sonarcloud/scan
  • Language: Python

We are facing some issue with specific project on our organization.
We didn’t change any config that may cause this impact, and the task that used to take ~ 5 min to complete, now takes 1h+ and some cases, up to 2 hours.

Just notice that now the sonar goes through several files that it didn’t go through before
INFO: 6589 source files to be analyzed
INFO: 79/6589 files analyzed, current file:
INFO: 81/6589 files analyzed, current file:
INFO: 85/6589 files analyzed, current file:
INFO: 91/6589 files analyzed, current file:
INFO: 95/6589 files analyzed, current file:
INFO: 101/6589 files analyzed, current file:
INFO: 110/6589 files analyzed, current file:
INFO: 112/6589 files analyzed, current file:
.
.
.

INFO: SonarQube Scanner 4.1.0.1829
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 5.15.0-1030-aws amd64
INFO: SonarQube server 8.0.0.42767
INFO: Sensor cache enabled
INFO: Load sensor cache
INFO: Load sensor cache (10 MB) | time=2452ms

INFO: The Python analyzer was able to leverage cached data from previous analyses for 0 out of 27 files. These files were not parsed.
INFO: Sensor Python Sensor [python] (done) | time=1743ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=7613ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=6858ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor JavaScript/TypeScript analysis [javascript]
WARN: Using Node.js version 14 to execute analysis is deprecated and will stop being supported no earlier than May 1st, 2023. Please upgrade to a newer LTS version of Node.js [16, 18]

INFO: 6521 source files to be analyzed
INFO: Time spent writing ucfgs 125ms
INFO: Analysis total time: 1:44:19.261 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:44:31.109s
INFO: Final Memory: 159M/489M
INFO: ------------------------------------------------------------------------
CircleCI received exit code 0

Hello @rafael-loggi.

thanks for your feedback. Indeed last changes seem to have affected projects with several tsconfigs. Can you please confirm that’s your case?

One workaround until we provide a fix is to provide the sonar property sonar.typescript.tsconfigPath pointing to the base tsconfig in the project root. Let me know if that helps in your case.

Thanks,
Victor

Hi Victor!

We’ll test it, and let you know ASAP, if everything works good.

Regards,

We try:
sonar.typescript.tsconfigPaths=targets/**/*

And got this:

INFO: Sensor JavaScript/TypeScript analysis [javascript]
INFO: 6590 source files to be analyzed
INFO: Resolving TSConfig files using ‘targets/**/*’ from property sonar.typescript.tsconfigPaths
INFO: Found 380019 TSConfig file(s): [/opt/loggi/workspace/targets/.gitignore,

The job was canceled, because lack of resource CPU and RAM.

INFO: Hit the cache for 79 out of 80
INFO: Miss the cache for 1 out of 80: FILE_CHANGED [1/80]
INFO: Sensor JavaScript/TypeScript analysis [javascript] (done) | time=316230ms
INFO: Sensor JavaScript inside YAML analysis [javascript]
INFO: No input files found for analysis
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor JavaScript inside YAML analysis [javascript] (done) | time=11ms
INFO: Sensor CSS Rules [javascript]
INFO: Sensor CSS Rules is restricted to changed files only
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=12ms
INFO: Sensor JavaScript/TypeScript Coverage [javascript]

Hi @rafael-loggi,

can you please set sonar.typescript.tsconfigPaths to a single tsconfig file? if you have a main one in the project root with the needed compilerOptions, it should be enough. Otherwise, creating a sonar tsconfig with just the needed compilerOptions should also help. No need to specify inclusions or files on it. This workaround seems to be working for most users until we provide a fix:

Cheers,
Victor

The workaround worked. We are tracking/following up new workflows.

Is there any ETA for the FIX?

BTW, this problem has impacted our projects for 7 days long until someone report as a problem, so where we can can track/receive these changes?

1 Like

Hello @rafael-loggi,

usually, the place to keep track of the changes on each release is on the Github repo for JS/TS analyzer:

But we don’t put into the release notes internal changes about how the analysis is done. Starting in version 10.3 there was a new strategy on tsconfigs which caused these issues.

Hopefully, we can publish a bugfix release next week.

Cheers,
Victor

Victor,

Ok.
thank you for keeping us posted.

Regards.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.