Deactivated rules are not applied

Hello,

I bound the project with the project key in the plugin settings. Unfortunately, the deactivated rules are not applied. The rules are applied in SonarCloud. I have deactivated the rules in SonarCloud.

IntelliJ: 2024.3
SonarLint Plugin: 10.12.0.79769

Why is not this working? How can I see which RuleSet SonarLint is loading and using from SonarCloud?

The Connected Mode documentation contains the following sentence:

When binding your local workspace folder to your SonarQube or SonarCloud project(s), SonarLint will try to match, as much as possible, the same rules and settings as found on the server.

Why just “will try to match”? Why just try? Is it not working properly?

Hi,

The rules that can run in SonarLint are a subset of those used for full SonarQube Cloud (nee SonarCloud) analysis.

I don’t understand the complaint. If they’re deactivated, I would not expect them to be applied…?

 
Ann

I have deactivated rules in SonarCloud! The deactivated rules were still active in SonarLint. If I connect SonarLink with SonarCloud, it is to be expected that the deactivated rules are also deactivated in SonarLint.

Hi

Are you saying that the deactivation is not applied and the rules are run even though they shouldn’t be?

 
Thx,
Ann

Yes, the disabled rules were still applied in SonarLint. For example, I disabled php:S2003 and many other rules in SonarCloud. In SonarLint (IntelliJ), php:S2003 and the other disabled rules were still applied.

Yesterday I cleared the IntelliJ cache. Now the disabled rules seem to be applied in SonarLint. The Analytics result in SonarCloud and SonarLint do not match.

  • Why do I need to clear the cache?
  • How can I manually trigger the sync?

Hi,

I’m glad you got this working. I believe the sync happens when you restart the IDE.

Can you provide specifics here?

 
Ann

I hope this is a joke? I would understand that SonarLint updates the configuration when I start an analytics process with SonarLint. But you have to restart the IDE?!

The SonarLint plugin is updated so frequently that I see the problem as being with the plugin and that you don’t have a stable plug-in under control.

For example, SonarLint shows php:S4790 for a file, but SonarCloud does not.

Security
SonarLint 3 Issues / SonarCloud 1 Issues

Reliability+Maintainability
SonarLint 5 Issues / SonarCloud 14 Issues

The list of issues in SonarLint does not exactly match the list of issues in SonarCloud.

Hello,

I hope this is a joke? I would understand that SonarLint updates the configuration when I start an analytics process with SonarLint. But you have to restart the IDE?!

SonarLint synchronization for deactivated rules with SonarCloud happens in a few cases:

  • Once every hour
  • At IDE startup
  • When binding the project

This is a limitation with SonarCloud that does not exist with SonarQube, where changes are automatically propagated to SonarLint in almost real-time. This, however, concerns only rule modifications. You should receive other events in real-time, such as the issues status being modified or the new Quality Gate status.

Synchronizing on every analysis would not be possible, this is an operation that takes a few seconds up to more than a minute. SonarLint can trigger analysis every second, this is why we need a very fast response time.

Please note that clearing the cache should not impact the synchronization process.

The SonarLint plugin is updated so frequently that I see the problem as being with the plugin and that you don’t have a stable plug-in under control.

This synchronization behavior has always existed, and we have made efforts in the past year to promote real-time events on both SonarQube and SonarCloud. If you feel that we are still lacking some features, we would gladly hear about them so they can be considered.

Hello,

Please note that clearing the cache should not impact the synchronization process.

I had opened and closed Intellij several times and re-bound the project in SonarLint. Even after 2-3 hours, the rules were not synchronised. Only after I had cleared the Intellij cache, SonarLint observed the deactivated rules.

If you feel that we are still lacking some features, we would gladly hear about them so they can be considered.

  • View when the last synchronisation took place*.
  • View which rule sets have been synchronised with SonarCloud and SonarCube and are in use.*
  • View which rules are enabled and disabled so you can check them.*
  • Start the synchronisation manually.
  • View the analysis results as in the SonarCloud summary.

*) Without having to dig through a logs.

Hi André, I’m sorry to hear about your frustration. Your feedback is very valuable. We will explore real-time synchronization of rule modification between SonarQube Cloud and SonarQube IDE and will let you know about any updates.

I am keeping a record of these improvement suggestions to collect similar requests and prioritize these for future iterations

  • View when the last synchronisation took place*.
  • View which rule sets have been synchronised with SonarCloud and SonarCube and are in use.*
  • View which rules are enabled and disabled so you can check them.*
  • Start the synchronisation manually.
  • View the analysis results as in the SonarCloud summary.

Thank you again.

2 Likes