We are struggling with the extensive analysis time for PR, which usually takes approximately 35 minutes for a 38k lines codebase.
Is this time frame typical for projects of this kind?
If not, what can we do to speed it up? Would it be helpful to post information about good practices for speeding up the analysis step, either here or somewhere else? I have a feeling that this topic arises from time to time, but the answers provided do not seem to be applicable to other projects.
Have you analyzed the main branch? I would expect only the changed files to be analyzed in a PR and the rest of the data analysis needs to be filled in from cached data from the main branch? If you have analyzed main (or the reference branch, altho to be clear I’m not sure on that point) then this could be a problem with the detection of new code.
Could you share your analysis log?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
In the meantime, I’ve made a change to the configuration - the analysis scope has been modified for development and test files, based on this → Analysis Scope | SonarCloud Docs. This has reduced the analysis time (it’s currently around 16-18 minutes for PR), but there might still be a chance to make it even faster.
I will write to you a private message so you can send me a link for the file.
I noticed that you have a huge amount of tsconfig.json files in your project. This is indeed costly for the TypeScript parser.
Also, we perform quite a lot of storage IO. What is the disk type that you use?