IntelliJ version:IntelliJ IDEA 2022.3.2 (Ultimate Edition) Build #IU-223.8617.56, built on January 26, 2023
Programming language you’re coding in: Java
Is connected mode used:
Connected to SonarCloud or SonarQube (and which version): Yes
SonarQube Community Edition v10.7 (96327)[ACTIVE]
And a thorough description of the problem / question:
Hi Guys!
I’m facing a problem, where the issues detected by Sonar are not picked up/displayed by SonarLint in my IDE. I’ve binded the SonarLint to my locally run SonarQube.
I’ve intentionally put a code smell in my code (namely a wildcard import rule java:S2208 violation), and ran a mvn sonar analyze, as well as a SonarLint analyze.In my SonarQube (localhost:9000), I saw the issue getting recognized, however no matter how I tried (running Analyze Current File, Clearing Cache and Restarting, running an analyze with mvn, etc…), I simply could not get SonarLint to display it in the issues tab (and nowhere else obviously). I looked up the verbose logs, and when I was still using the version 7x sonarLint, I got the log: Rule java:S2208 is enabled on the server, but not available in SonarLint, but after upgrading to the version I mentioned above (10x), I no longer get this log line, but the issue still persists (so upgrading SonarLint didn’t work).
I’ve already read through the similar posts, but I can’t find any genuine solution for problems like this.
The rule is contained by a custom rule profile, which I set as a default one.
I also get a log line: [2024-11-29T16:56:07.207] [SonarLint Server RPC request executor] ERROR sonarlint - No file to analyze
when I’m trying to analyze one of my java files.
Could someone please help me overcome this problem?
Thank you
BR, Erik
Hello @ErikCsipak, thanks for reaching out to us about this!
No file to analyze
This log is definitely not normal. Could you make sure the file you are trying to analyze is part of the project? We rely on the project structure of your IDE to analyze the files. Any file that is not part of the project or excluded in some way will be ignored.
Thanks for reaching out! Yes, the file I try to analyze is definitely in the project. I have a root directory, which is being recognized as a project by IntelliJ. Next I have multiple sub-modules, and these sub-modules branch down to 3-4 depth. So it looks something like:
root-module
sub-module1
sub-module2
sub-module3
…
sub-moduleX
sub-moduleX1
sub-moduleX2
sub-moduleX3
sub-moduleX31
sub-moduleX32
sub-moduleX33
sub-moduleX331
src
main
java
my.package
control
FileToAnalyse.java
So as you can see, it’s quite a big project. Does SonarLint have any limitations regarding project size, or module architecture?
Thank you for your answer!
BR, Erik
Sure!
Connected mode is enabled. I deleted some confidential lines from the logs, mainly the extraParams, but you should get an idea of the problem this way too.
It seems that your file has been ignored due to git:
[2024-12-04T09:49:15.189] [SonarLint Server RPC request executor] DEBUG sonarlint - Filtered out URIs ignored by Git: file:///C:/Users/user/MyProject/core/loader/p-loader/p-loader-ld/p-loader-ldfdd/src/main/java/com/company/proj/myproject/loader/fdd/control/k/MyFile.java
We rely on the .gitignore file to exclude unwanted files from analysis. Could you confirm that your file is effectively being ignored by your git configuration?