SonarQube for IDE: Not Detecting Violation

Please provide

  • Operating system: 23H2 Build 22631.4830
  • SonarQube for IntelliJ plugin version: 10.16.1.80464
  • IntelliJ version: IntelliJ IDEA Ultimate 2024.3.2.2
  • Programming language you’re coding in: Java
  • Is connected mode used: Yes, but the problem also occurs in standalone mode.
    • SonarQube Community Version 9.9.2 (build 77730)

And a thorough description of the problem / question:

Hi,

I’m encountering an issue with the SonarQube integration in IntelliJ IDEA Ultimate 2024.3.2.2, using the SonarQube for IDE plugin version 10.16.1.80464.

I have followed the non-compliant code example from the SonarQube rule RSPEC-1161, and implemented it in my project, but the analysis does not detect any violations. Despite the code clearly violating the rule, the analysis reports “0 issues detected.” For other rules, violations are detected.

This problem occurs in both Standalone Mode and Connected Mode.

Thank you in advance for your help!

Hi,

Welcome to the community!

Are the classes in the same file? Not all of the rules are able to detect issues cross-file, and I believe this is one of them.

 
Ann

Hi,

thank you.

I tried it out: If the classes are in the same file, the rule works and the issue is detected. However, in real projects, this configuration is more the exception. In most cases, the parent method, interface and abstract method are in separate files.

Hi,

Yes, that’s a fair point. I’ll flag this for the language experts.

 
Ann

Hello @OliH

I have tried the use case, and I have to agree that the first time, SonarQube for IDE didn’t detect the issue if the parent class was in another file (the common case).

But, after compiling the project now it shows the issue as expected :

And, from the very first analysis, SonarQube detected it :

I’m working on isolated mode

I’m using SonarQube IDE 10.16.1.80464