We currently use monolith repositories for our services written in java(npm,yarn) and python Wanted to know how can I improve on the time sonar takes to run? Is there away I can only run the scan on the new/changed code. We are currently using the community version but happy to explore the paid versions if this problem is solved.
Can you share some details about the size of your repos, in particular the number of Lines of Code for each Languages (you can find this info in SQ itself), the number of files and the total time to scan them?
(don’t forget to mention the version of SonarQube you are using also).
We are working to improve the scan time of Pull Requests so that only the changed files in PR are analyzed instead of analyzing all the files (and report issues only on changed files). This is not yet available but hopefully should come in 2022. This will be a feature of SonarQube Developer Edition.
Sonarqube version - 8.9.2
Sonar Scanner version - 4.6.2
Time for scan - ~4min15secs
I noticed there are some error messages related to eslint, that may have caused the delay. Attaching the log file. Have edited the file to remove some sensative data.
Hi @Lena, apologies, I missed the log file. adding it here log (9).txt (8.6 KB). The lines ```java.io.IOException: Cannot run program “/home/jenkins/agent/workspace/Belongweb-sonarqube/.scannerwork/ce228c7b0152b0d6616c9bf171b8aaec-codescan-language-eslint-linux”: error=2,’’’ I think are the problem areas . Can you help please?
Thanks Alex, We are already running sonar on linux machines with JDK 12, since I have already requested a developer edition trail license, not planning on upgrading the CE version.
We are really looking forward to "analyze only the changed files in a PR " feature to come through to the SonarSource analyser , any ETA for now?
Is there a Jira Issue that I can keep an eye on?
Please provide the full log, not only the final part of it, I want to see which sensors are taking the time. Regarding CodeScanLang, I don’t know what it is, probably some community plugin you have installed, but definitely it’s not taking it long to fail, just 3 seconds
has still status OPEN and no Fix version/s and it seems it needs some push again !?
Our developers ask nearly every week for support of scan in parallel.
“Some teams nevertheless use the Sonarqube analysis in parallel, the duration of the analysis
is reduced from 8-9 mins to 2-3 mins.” ain’t bad !?
As i wrote before, this would be a way to speed up the analysis in general - regardless of the language.
Guess it’s not only relevant for Jenkins, but also for similar tools.