We hadn’t sonar in use for one month, so recently we updated sonarqube to version 8.1.
With that update we migrated our database to another server (before it was on the same server).
On the old configuration a scan took about 2 minutes.
Now with the new setup scanning takes a half an hour for the typescript files. In 10 seconds he scans 13-16 files.
I also tested it locally on my computer which doesn’t change anything. The server CPU isn’t even used with its full capacity.
The command for running the scanner is: sonar-scanner.bat -Dsonar.test.inclusions=**/*.test.*,**/*.spec.*,**.int.* -Dsonar.projectKey=frontend -Dsonar.projectName=Frontend -Dsonar.host.url=https://our.domain.com/ -Dsonar.login=******** -Dsonar.language=ts,html,css
thank you @Alexandre_Gigleux for your help. Sadly i have still the same issues even after i applied your suggestions.
I updated SonarQube to 8.2, i updated the sonar-scanner-cli to the latest version and i set sonar.cps.exclusions=** which the scanner is caring.
But i have still problems that the scanner is too slow (28 files in 10 seconds).
Sonarqube-scanner 2.6.0 with the newest sonar-scanner-cli
The project contains more than 4900 typescript source files and over 20 tsconfig.json files.
Looking at the log, most of the steps (e.g. indexing files, matching files to tsconfig.json, etc) only take few seconds to finish. But when it comes to the analysis of the >4900 typescript files, it takes ~2 hours.
Do you have an idea where this long duration comes from?
My guess would be that it has to do with sending AnalysisRequest and/or getting AnalysisResponse in TypeScriptSensor.java but I might be wrong.
Our current guess is that there is a lot of memory used, so a lot of time is takes by allocating. But so far we didn’t get any reproducer in our hands so we can’t debug and improve that.
You would help us a lot if you could provide us sources of your project, privately of course.
i would like to provide you our project. But unforntunately our project (enterprise) is not to give it to someone… my boss forbid it explicitly.
Sorry.
Maybe i can reproduce it with another small project. But that needs a lot of time.
Here is a Repository with our Project structure in obfuscated.
The typescript files doesn’t contain real code.
In this state SonarScanner is slow (6 files per second). To speed it up: Remove the typings directory either through removing it in the tsconfig, removing the directory itself or copy all files from typings/eit to typings and remove the eit directory.
After that SonarScanner scans 30 files per second which is 5 times faster than before!
With out original project the scanner scans 2-3 files per second.
I didn’t have so far any time to investigate your reproducer, but that’s certainly on my todo.
I will ping you as soon as I have any info.
Thanks for the help anyway!