How to fix deprecated rules

Dear Support,

I recently visited Quality Profiles and realised some deprecated rules. Is there any action needed from the administrator to address these?

Quality_Profiles_-_Ansarada

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

Example:
I see javascript:S4787 rule as deprecated.
Following the advise above, what would happen if I click the Activate button?

Regards,
Przemek

Hello,

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

Alex