Extending a rule description: extension on top, and per quality profile?

[Editing this to change from a question to a new feature request]

Suggested enhancements for the feature of extending a rule description (mainly thinking of built-in rules rather than custom rules):

  1. Make the extension to the rule description something that can be bound to a particular quality profile, much like the rules that can be parameterized for each profile, such as max method count.

  2. Provide a per-rule option to make the extension to the rule description appear at the top of the description rather than the bottom. Alternately, a simpler approach would be to have some text or an icon at the top of the rule description (as shown when clicking on “Why is this an Issue?” or when viewing the description in SonarLint) to indicate there’s a custom extension to the description. (So you’d still have to scroll down to see the extension, but you’d only have to do that when you know there’s an extension.)

My motivation for #2 is that we tell developers that, in general, they are expected to fix anything reported by SonarLint, in the parts of a file they are modifying, before committing their changes. But there are many code smell rules, particularly those of the too-many-blahblah variety, where they are probably good practice most of the time, but there are always exceptions. In other words, we view these more as guidelines rather than hard-and-fast rules. We’d like developers to think about, for instance, whether that method really needs more than 7 parameters (rule java:S107). On the other hand, if the method REALLY needs more, we’d rather not have them do something hideous like bundle some parameters into a new object when they don’t really make sense together, just to satisfy a rule.

So we would like to add a note to that effect by extending the rule description to say, yes, you can break this rule, but you might be asked about it at the next code review, or some such. But it would be nice to see that on top when they click on the description link in SonarLint, or see the “there’s something below” notification (depending on which implementation of #2 you choose). Many of the descriptions are rather long, and developers might complain about having to scroll down every time to see if there’s an extension.


First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.6 → 8.9.6 → 9.2.4 (last step optional)

You may find the Upgrade Guide helpful.

Regarding your questions, neither of these things is currently available. Feel free to move this topic to the New Features category.