I recently visited Quality Profiles and realised some deprecated rules. Is there any action needed from the administrator to address these?
The documentation says:
Deprecated : The rule should no longer be used because a similar, but more powerful and accurate rule exists.
But nothing regarding how to replace rules.
I did a bit of research and found some questions regarding specific rules, e.g. here
There’s a topic in Stackoverflow: SonarQube 6.4, deprecated rules and how to fix them
Following the advise above, what would happen if I click the
Rules are marked as deprecated when we no longer believe in the value provided by the rule or when some rules are re-organized (case of merge or split of rules). Generally the rule is replaced by a new one and the replacement rule is documented in the deprecated rule’s description.
The built-in “Sonar way” Quality Profile is automatically updated for you: deprecated rules are removed and new rules are activated on it.
For your custom Quality Profiles, you should do the same manually:
- remove the deprecated rules from them
- decided if you want to use the new rules
Thank you for the response.
Sorry, it’s still a bit unclear to me in two areas:
- “Sonar way” Quality Profile is automatically updated for you
- How do I know which rules should I enable in place of deprecated ones?
 In the screenshot attached above, I see “Sonar way” quality profile with deprecated rules. What is the timeframe for these rules to be replaced? I feel anxious about seeing a big red box sitting in Quality Profiles.
I’m circulating back as I did not hear from you.
I’m aware my previous response was 6 days delayed, but I got distracted with something.
Could we continue this thread?
For the case of S4787 for Java, it’s written this:
This rule is deprecated, and will eventually be removed.
It means you are informed that we no longer believe in this rule and but there is no replacement yet.
For some other rules there is an explanation of which rule to activate as a replacement: