Sonar Scanner from 4.8 to 5.0 angular code increased the scan time from 4 to 18mins with SonarQube 9

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarScanner 5.0.1 from 4.8.0
    SonarQube is same: 9.9.0
    Java: from 11.0 to 17.0

  • how is SonarQube deployed: zip, Docker, Helm

  • Docker
  • what are you trying to achieve
    Scanning source code for analysis
  • what have you tried so far to achieve this
    Looking what might have caused this increase in scan time from 4 to 18mins for the same source code with JavaScript and Angular in it.
    Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
    When compared the logs of old vs new almost same number of files, same scanner taking more time now,

Hey there.

Thanks for the report. Can you share the logs of a project that reproduces this issue (faster analysis on Java 11 than Java 17, with the exact same code)?

@Colin
Sorry I could not get back to you with the log that time, but on same repo we continue to see increase in sonar validation time, here I can share a bit of log for the same for one package, where I see its not using cache and all the files are cache miss

`INFO: Sensor TypeScript analysis [javascript]
INFO: Resolving TSConfig files using './tsconfig.sonar.json' from property sonar.typescript.tsconfigPath
INFO: Found 1 TSConfig file(s): [/home/jenkins/workspace/r-common_fix_sonar-ignore-images/***./tsconfig.sonar.json]
INFO: Creating TypeScript program
INFO: TypeScript configuration file /home/jenkins/workspace/r-common_fix_sonar-ignore-images/**/./tsconfig.sonar.json
INFO: 818 source files to be analyzed
INFO: Creating TypeScript program (done) | time=2907ms
INFO: Starting analysis with current program
INFO: 153/818 files analyzed, current file: /home/jenkins/workspace/r-common_fix_sonar-ignore-images/**/src/xyz.component.ts
INFO: 392/818 files analyzed, current file: /home/jenkins/workspace/r-common_fix_sonar-ignore-images/zzz-end.component.ts
INFO: Analyzed 477 file(s) with current program
INFO: Skipped 341 file(s) because they were not part of any tsconfig.json (enable debug logs to see the full list)
INFO: 818/818 source files have been analyzed
INFO: Hit the cache for 0 out of 477
INFO: Miss the cache for 477 out of 477: ANALYSIS_MODE_INELIGIBLE [477/477]
INFO: Sensor TypeScript analysis [javascript] (done) | time=24193ms`

The sonar scan happens in a docker containers, where we don’t have mechanism in place to persist cache between CI builds, is there any config / setting missing

25 seconds (24193ms) for analyzing 818 files doesn’t look so bad. Where is the bulk of the analysis time taking place?