SonarCloud JavaScript Analysis Super Slow

Template for a good new topic, formatted with Markdown:

  • ALM: Bitbucket Cloud
  • CI: Bitbucket Cloud
  • Scanner command: sonar-scanner cli (version 4.8.0.2856)
  • Languages: JavaScript
  • Error observed: scanner took about 10 seconds to analyze 2-4 files
  • Potential workaround: Seems removing node_modules before scan help to increase analyze speed to 30-50 files per 10 seconds.

This happen since 16 June 2023, the analysis speed just plummet out of sudden, we are using sonar-scanner cli on an EC2 instance with 32CPU and 64GB RAM, it scan for more than 1 hour and the pipeline timed out, the entire scan used to be less than 3 minutes

Compare to our previous log, INFO: Sensor JavaScript/TypeScript analysis [javascript] is new here

Here’s the log before the performance issue hit us, it used to be very fast:

INFO: Sensor TextAndSecretsSensor [text]
INFO: 1873 source files to be analyzed
INFO: 1873/1873 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=6931ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=10ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
INFO: Sensor JavaScript analysis [javascript]
INFO: Creating TypeScript program
INFO: 1620 source files to be analyzed
INFO: TypeScript configuration file /apps/runner/temp/aa5f3f0e-3b33-5aa3-baf3-5a70428f6a0e/build/.scannerwork/.sonartmp/15975975701609773204.tmp
INFO: Creating TypeScript program (done) | time=4858ms
INFO: Starting analysis with current program
INFO: 7/1620 files analyzed, current file: /redacted_source_code.js
INFO: 227/1620 files analyzed, current file: /redacted_source_code.js
INFO: 442/1620 files analyzed, current file: /redacted_source_code.js
INFO: 615/1620 files analyzed, current file: /redacted_source_code.js
INFO: 792/1620 files analyzed, current file: /redacted_source_code.js
INFO: 1000/1620 files analyzed, current file: /redacted_source_code.js
INFO: 1201/1620 files analyzed, current file: /redacted_source_code.js
INFO: 1400/1620 files analyzed, current file: /redacted_source_code.js
INFO: 1603/1620 files analyzed, current file: /redacted_source_code.js
INFO: Analyzed 1620 file(s) with current program
INFO: 1620/1620 source files have been analyzed
INFO: Hit the cache for 0 out of 1620
INFO: Miss the cache for 1620 out of 1620: ANALYSIS_MODE_INELIGIBLE [1620/1620]
INFO: Sensor JavaScript analysis [javascript] (done) | time=92955ms
INFO: Sensor TypeScript analysis [javascript]

Here’s the log that is super slow, I had to exclude a few folders to get it run a little faster, thus the number of files is lower here

INFO: Sensor TextAndSecretsSensor [text]
INFO: 1444 source files to be analyzed
INFO: 1444/1444 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=976ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=10ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor JavaScript/TypeScript analysis [javascript]
INFO: 1444 source files to be analyzed
INFO: 3/1444 files analyzed, current file: /redacted_source_code.js
INFO: 6/1444 files analyzed, current file: /redacted_source_code.js
INFO: 8/1444 files analyzed, current file: /redacted_source_code.js
INFO: 10/1444 files analyzed, current file: /redacted_source_code.js
INFO: 13/1444 files analyzed, current file: /redacted_source_code.js
INFO: 15/1444 files analyzed, current file: /redacted_source_code.js
INFO: 18/1444 files analyzed, current file: /redacted_source_code.js
INFO: 22/1444 files analyzed, current file: /redacted_source_code.js
INFO: 25/1444 files analyzed, current file: /redacted_source_code.js
INFO: 27/1444 files analyzed, current file: /redacted_source_code.js
INFO: 30/1444 files analyzed, current file: /redacted_source_code.js
INFO: 33/1444 files analyzed, current file: /redacted_source_code.js
INFO: 37/1444 files analyzed, current file: /redacted_source_code.js
INFO: 41/1444 files analyzed, current file: /redacted_source_code.js
INFO: 47/1444 files analyzed, current file: /redacted_source_code.js
INFO: 49/1444 files analyzed, current file: /redacted_source_code.js
INFO: 53/1444 files analyzed, current file: /redacted_source_code.js
INFO: 56/1444 files analyzed, current file: /redacted_source_code.js
INFO: 59/1444 files analyzed, current file: /redacted_source_code.js
INFO: 62/1444 files analyzed, current file: /redacted_source_code.js
INFO: 65/1444 files analyzed, current file: /redacted_source_code.js
INFO: 68/1444 files analyzed, current file: /redacted_source_code.js
INFO: 71/1444 files analyzed, current file: /redacted_source_code.js
INFO: 74/1444 files analyzed, current file: /redacted_source_code.js
INFO: 77/1444 files analyzed, current file: /redacted_source_code.js
INFO: 79/1444 files analyzed, current file: /redacted_source_code.js
INFO: 83/1444 files analyzed, current file: /redacted_source_code.js
INFO: 85/1444 files analyzed, current file: /redacted_source_code.js
INFO: 89/1444 files analyzed, current file: /redacted_source_code.js
INFO: 92/1444 files analyzed, current file: /redacted_source_code.js
INFO: 95/1444 files analyzed, current file: /redacted_source_code.js
INFO: 100/1444 files analyzed, current file: /redacted_source_code.js

Hi,

This thread will probably help.

Please let me know if it doesn’t.

 
Ann

Don’t think it’ll help, our repo is pure JavaScript so there’s no tsconfig for us to begin with

1 Like

Hi @Sean_Foo,

in the case of JS, this should be the workaround until we release the fix.

Thanks,
Victor

1 Like

This help!

2 Likes