Could you try the following: disable rules S4328 and S5973 from your quality profile and run the analysis again?
We have introduced a new feature fetching info from package.json files in these rules which might be resource-heavy. If your issues disappear after this, we will have found the culprit.
I tried to delete node_modules/ folder before running the analysis, and the issue didn’t occur.
I consider this is a workaround for this issue. Could you explain why?
The pipeline is still having the issue sometimes, it’s intermittent. After all, deleting node_modules is just a workaround, the root cause hasn’t been found and fixed.
We have introduced a new feature in SonarJS 10.10.0 to gather available dependencies
and their versions to improve the behaviour of several rules. Having seen more than 2k lines such as: ... DEBUG: Found package.json ... pointing to the node_modules/ folder would suggest that our current implementation can be optimized.
I am also facing this problem using - pipe: sonarsource/sonarcloud-scan:2.0.0
19:41:13.531 INFO: SonarScanner 5.0.1.3006
19:41:16.733 DEBUG: SonarCloud 10.3.0.1951
and i dont have node_module in my repo, just specify directories in the “sonar-project.properties” file for analysis
I was able to find the solution with the help of a sonar member. In my case, I was using one of the default images provided by sonar called atlassian/default-image:4. The problem was related to docker image memory so I increased it to 2048, like this:
definitions:
services:
docker:
memory: 8192
And now It works very well and all my files are read.
Hello, i have the same issue, i went from sonarsource/sonarcloud-scan:1.4.0 which it was working well,
to sonarsource/sonarcloud-scan:2.0.0 which is not working now.
This is my bitbutcket-pipeline
image: atlassian/default-image:3
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
services:
docker:
memory: 4096
type: docker
steps:
- step: &codeAnalysis
name: Code Analysis
services:
- docker
size: 2x
image: node:latest
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
caches: # Caching artifacts to speed up the buil
- node
- sonar
script:
- yarn install
- pipe: sonarsource/sonarcloud-scan:2.0.0
variables:
SONAR_SCANNER_OPTS: -Xmx4096m
EXTRA_ARGS: -Dsonar.javascript.node.maxspace=8192
- pipe: sonarsource/sonarcloud-quality-gate:0.1.6
pipelines:
branches:
develop:
- step:
<<: *codeAnalysis