Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling Deprecated Rules in Sonarqube #1142

Closed
schulmak opened this issue Jan 24, 2025 · 2 comments
Closed

Handling Deprecated Rules in Sonarqube #1142

schulmak opened this issue Jan 24, 2025 · 2 comments

Comments

@schulmak
Copy link

Hey

Since the update to Sonarqube 10.8.1 (old version: 10.7), we got the message that there are a few deprecated rules, which are not possible to deactivate since they are built-in due the sonar-findbugs.
The currently installed version of sonar-findbugs is 4.3.0 (old version: 4.2.0).

Example:

  • Multi-threading - Incorrect lazy initialization of instance field
    Rule ID:findbugs:LI_LAZY_INIT_INSTANCE

I could find the rule in the changelog from the Quality Profile from the date where the plugin was added, but I could not find the change from "active rule" to "deprecated rule". Could you show / explain how the process is working for this? Did the change came from the Sonarqube update?

Other question: When will the quality profile be cleaned from the deprecated rules?

Thanks in advanche.

@gtoison
Copy link
Contributor

gtoison commented Jan 25, 2025

Hello,
These rules were deprecated in #386 which I believe was in version 4.0.5 of the plugin.
The way it works is that SpotBugs (and its plugins) declare some bug pattern (such as LI_LAZY_INIT_INSTANCE) and the plugin creates SonarQube rules for each of these bug patterns.
SpotBugs has a deprecated flag, but until #386 it was not taken into account.

Regarding findbugs:LI_LAZY_INIT_INSTANCE the corresponding was SpotBugs bug pattern was deprecated since forever, and the change in #386 made the SonarQube rule also deprecated.

Note that #386 also deprecated rules that were overlapping as discussed in #304

@schulmak
Copy link
Author

schulmak commented Jan 27, 2025

Thanks for the information :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants