Ok, here is a “short” list. Maybe it is incomplete.
Nested "enum"s should not be declared static (java:S2786)
This rule shouldn’t be enabled by default, because it doesn’t bring up a bug or a code smell, but
just “style”. I believe, static is correct here to point out, that we don’t want hidden references
to enclosing instance like it is the case for regular inner classes. Yes, enums are always static.
But like using public modifier for interface methods, even if it is default, even enforcing/encouraging
static modifier here is a good idea.
Cognitive Complexity of methods should not be too high (java:S3776)
This rule belongs to the ones, that should never be active for regular tests, but just applied on demand.
Some methods are complex, because they are complex. Yes, you could split them up into several methods.
But this doesn’t always recude cognitive complexity.
“Never change a running system.” So, you will probably not tough these too complex methods ever. But
suppressing the issue is not a good solution, too. Hence this rule should not be applied for regular
test runs, but just on demand through an explicit “strict” analysis.
Local variables should not be declared and then immediately returned or thrown (java:S1488)
This rule should be optional. It doesn’t describe a bug and not even a code smell in my opinion.
When Eclipse didn’t show the method return value in the debugger you had to help yourself by writing
the return value to a variable before returning it. So this thingy will show up a lot in existing code.
Even since Eclipse does show the return value in the debugger, it is not any kind of bad practice to
store the value of a (complex) computation to a variable just to return that variable.
It is not even a matter of reduced performance. In contrary the degugger performance is highly reduced
due to that option. In the end it is just style. And no default rule should comply about that.
Sections of code should not be commented out (java:S125)
This rule belongs to the ones, that should never be active for regular tests, but just applied on demand.
Sometimes you may want to know, where code has been commented out and molds there for a long time.
But for every day code work, it is absolutely ok to comment out some code. It sometimes even has
important documentary character.
Track uses of “FIXME” tags (java:S1134)
Track uses of “TODO” tags (java:S1135)
Deprecated code should be removed (java:S1133)
(maybe others like that)
Eclipse (like other IDEs, I think) have separate tools to list TODOs. It is of no worth to list them
as bugs or code smell in sonar. At the very least, these rules should be deactivated by default.
S1133 is very similar. You don’t want to be notified about that in your every day code report, but
just check that before a new release or so.
“switch” statements should have at least 3 “case” clauses (java:S1301)
This rule often hits for switches, that are either still in the works or which’s enums are still being
developed. So for most cases this doesn’t show up a code smell, but just list, where you’re currently
working on.
This rule should be applied on demand only and not be activated by default.
“throws” declarations should not be superfluous (java:S1130)
This rule complains about RuntimeExceptions bein explicitly thrown. This has documentary character
and is in no way a code smell or bug.
While some may consider this rule useful, it should not be active by default.
This rule also hits redundant exceptions due to inheritance. This is of more use, but also not really
a bug or even code smell, but just has info character.
Methods should not have too many parameters (java:S107)
This rule belongs to the ones, that should never be active for regular tests, but just applied on demand.
You’ll probably not “change a running system” just to reduce the number of parameters.
Collapsible “if” statements should be merged (java:S1066)
I don’t think, it is a good idea to always merge collapsible if statements. This potentially produces
unreadably long lines and doesn’t help when debugging.
This rule should be optional and be deactivated by default.
Unused method parameters should be removed (java:S1172)
Eclipse gives you the option to ignore unused method parameters, if they’re either documented,
annotated with ignoreWarnings or the method comes from an interface or abstract class. All three
options should be possible for this rule, too. And they should be “on” by default.
“static” base class members should not be accessed via derived types (java:S3252)
I don’t understand the worth of this rule at all. Should I change my code every time library code
decides to move a constant to a super class or interface? Is it important for me to know, in which
class or interface a constant is defined, if I use it though a sub class?