So… here’s a project as small as I can make it. It will not build, but it will illustrate my issue:
If you open app-header.component.ts and remove readonly from one of the injected services in the constructer, nothing happens in SonarCloud. But if you comment out the line this.currentUser = currentUser; (approx line 62) it is picked up by SonarCloud.
One thing I thought about is the fact that Angular as a framework is NOT present in package.json as it is bundled in @eui/deps-base. I don’t know if that could matter… RINA.zip (1.7 MB)
And I feel that I must state, that I did not write the code… I just maintain it and try to improve it.
I’m part of the team working on the JS/TS analyzer. Rule S2933 depends on the TypeScript type checker used in its implementation. For performance reasons, we disable this in the SonarQube for IDE context when projects files are above a certain threshold. You should see the following logs in that case.
The result is that some rules lose in precision.
You can edit this parameter with sonar.javascript.sonarlint.typechecking.maxfiles, which is set by default to 20k.
This behaviour is not present in the scanner context, that is why you would always see the issues on SonarQube Cloud.
However, the difference in behaviour between IntelliJ and WebStorm is indeed confusing. Is it possible that you fetch files in a different fashion, @nicolas.quinquenel ?
Regardless which IDE I use, I open the same folder on my local machine. I use Fork as my git client, but other thatn that I really don’t know what to say…
To give an update, we haven’t forgotten you but we also haven’t made much progress on your case. We haven’t had other reports for this issue and we cannot make a reproducer.
Could you please try the latest release of SonarQube for IDE, version 10.19, and see if the issue is still there?
It would also be great if you could share the full SonarQube for IDE logs, from the very start when you start your IDE, up to the analysis on WebStorm that does not raise the issue. It would help us to have more context on what’s happening.
Sorry for the late reply but I’m knee deep in a different part of my project.
Here’s a log as requested. I’m on SonarQube for IDE v10.21.0.81149. As before I’ve just removed a “readOnly” annotation on an injected service expected to get the same warning as I do on build server. But I don’t.
I’m yet another person who will try to investigate the issue you are facing
As I understood so far, rule S2933 is detected in the following environments
SonarQube Cloud
SonarQube for IDE: IntelliJ (without Binding)
SonarQube for IDE: IntelliJ - Connected Mode to with SonarQube Cloud
SonarQube for IDE: WebStorm (without Binding)
And you cannot get the issue to appear in SonarQube for IDE: WebStorm when connected to SonarQube Cloud. Is this correct?
I am not able to reproduce the problem you are facing. I opened a project in WebStorm and bound it to a SonarQube Cloud project, and I could still see the issue detected correctly.
And we have not received other similar reports either to help us understand the root cause. The problem could be due to SonarQube for IDE: WebStorm using incorrect Node.js version/path (you can verify this by going to the extension settings). Alternatively, something could be wrong with your connection, but it would not explain why things work in IntelliJ. Finally, you might need to adjust the analysis property as described above.
We really appreciate the time you took to provide us with additional details and logs, but unfortunately for now we still don’t know what is the problem because we don’t have full logs, from the very start when you start your IDE, up to the analysis on WebStorm that does not raise the issue . The latest logs you provided are generic IDE logs and not SonarQube logs, so it does not help
Yes you are correct in all your assumptions. What I would suggest is this:
As soon as my employer gets a new laptop delivered for me, I’ll set everything up on a completely fresh and untouched laptop. Then we can see if that works.
Well, if you are anyway getting a new laptop it would definitely be interesting to see if you will reproduce the issue again. If you will, we will still need full logs, from the very start when you start your IDE, up to the analysis on WebStorm that does not raise the issue.
In the meantime, maybe you could try to have a “fresh start” on your existing machine? For example to try and
That’s it! The logs should be starting with the line: Starting the SonarQube for IDE service process....
If you have multiple projects open in different WebStorm windows, they will be sharing the SonarQube for IDE backend process, so it might be the reason why you don’t see logs from the start in your project. So you will need to enable the logs, close all the projects, and open only the one with the problem, and then collect the logs.
I’ll try again… closed ALL IntelliJ programs (except WebStorm), checked the two log options and restartet WS. Then I removed ‘readonly’ from a couple of injected services and collected the logs…
Looks like the analysis succeeds and I don’t see any obvious red flags in the logs. Something that could be happening is a problem with issue storage. To test this theory, you can try to
Close WebStorm and IntelliJ
Remove the following files/folders
** $HOME/.sonarlint/storage
** $HOME/.sonarlint/known-findings-store-*
** $HOME/.sonarlint/xodus-*
Start WebStorm again.
I hope you can understand why it is so hard for us to pinpoint the actual problem.
All the best,
Sophio
I only had the storage folder but not the two others. It didn’t help removing that folder. I think we should just wait until I get a chance to do a clean setup.
Or maybe I could get the project you have that is actually working? Unless it’s the one I uploaded some time ago.