Environment
- OS: Windows 11 v10.0.26100
- SonarQube for IntelliJ plugin version: 10.17.0.80539
- IntelliJ version: 2024.3.3 (Ultimate Edition)
- Programming language you’re coding in: Typescript, Java
- Is connected mode used: Yes with SonarQube Cloud
Problem
My Sonarqube cloud shows me 20 issues for a particular file. This is using the ‘Sonar Way’ quality gate, so everything is on default settings. When I look in IntelliJ, it only shows me one issue, even though the log says it writes 20 issues to the store. I don’t understand why.
If I use an older version of the plugin (sonarlint-intellij-10.4.2.78113), the plugin shows me 6 problems without synchronising with the cloud and 18 with synchronisation. Not 20 yet, unfortunately, but that’s more or less what I expected from the latest version. I also adjusted the Node.js version for the plugin (18.20.5, 20.18.3, 22.14.0). With all of them I get the same result, 1 problem.
My log file does not seem to contain any errors…
We are using a monorepo with a structure like this:
reponame/
client/
src/
test/
api/
src/
client is an angular application and api is a springboot app.
I have setup our repo as monorepo in SonarQube Cloud and i did a scan for the client like this (in linux):
cd ~/reponame/client
sonar-scanner \
-Dsonar.organization=xy \
-Dsonar.projectKey=xy_reponame_client \
-Dsonar.sources=src/ \
-Dsonar.host.url=https://sonarcloud.io
when we open IntelliJ, we open the hole repo, so IntelliJ shows client and api simultaneously.
I could fix the issue when I only open the client in IntelliJ. The logs showed me first this error:
[2025-02-20T09:59:34.353] [nodejs-stream-consumer] ERROR sonarlint - The analysis will stop due to the Node.js process running out of memory (heap size limit 4144 MB)
[2025-02-20T09:59:34.353] [nodejs-stream-consumer] ERROR sonarlint - You can see how Node.js heap usage evolves during analysis with "sonar.javascript.node.debugMemory=true"
[2025-02-20T09:59:34.353] [nodejs-stream-consumer] ERROR sonarlint - Try setting "sonar.javascript.node.maxspace" to a higher value to increase Node.js heap size limit
After setting sonar.javascript.node.maxspace to 16384 in the Analysis Properties window. It worked correctly and showed me all 20 issues.
Having noticed this, I scanned the client module again, but this time like this:
cd ~/reponame
sonar-scanner \
-Dsonar.organization=xy \
-Dsonar.projectKey=xy_reponame_client \
-Dsonar.sources=client/src/ \
-Dsonar.host.url=https://sonarcloud.io
But it still did not work when I opened all the modules in the repo. Is this even possible (synchronising like this)?