Improve sonarscan time on python and java monolith repos

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.



Are you sure your monolith repos are made of Java? When I see “npm + yarn”, this makes me think about JavaScript or TypeScript but not Java.

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.


Thanks, yes we have a repo which has both java and JS code. But let me reference the one with javascript and typescript here. Below are the details.
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.