No, my point is that we should not have to write a custom rule to adapt an existing platform-provided rule that raises false positives. Not being able to tune a rule is not a good enough reason to write a custom rules. These are great in order to add new controls that are specific to a context that would not benefit the community as a whole, but they are a pain to maintain and they impact rule profiles maintainability when used to replace existing rules (I want to use the Sonar Way profile, but want to replace rule X with my custom rule X' and want to be true each time I update the Sonar Way profile). Parameterisation however is a good alternative in this context and is available right now.
If you consider parameterisation a pain and want an architectural solution, think about an adapter system, where each rule would be adaptable, would be able to retrieve available adapters that can be applied to it (based on its key, version min, version max) when an analysis is started. Each adapter would register itself for a given rule or set of rules (based on rule key and version) and would be able to modify or extend the rule's behaviour (add a behaviour to a chain of behaviours, limit added behaviour to a subset of resources based on preconditions, disable the standard behaviour based on a precondition checked each time the rule is executed, etc). Such adapters being simple POJOs it would be extremely easy for the community to write and UT test them (without having to use the existing test harness).
The community could then contribute adapter sets as new SQ plugins (for instance a set for OpenJPA, another one for Spring, etc) and adapter sets could be enabled automatically based on Maven dependencies, properties, metadata (jar manifest files for instance) you name it. This would allow you to remove all framework-specific code from the plugin and keep your rules as simple as possible.
If I exclude automatic detection of whether or not an adapter should be executed. On your side it means adding a new extension type for such adapters, an AdaptableRule class that retrieves and applies corresponding adapters, and an API that allows to retrieve information required to evaluate preconditions and execute or not the adapter. No more maintainability pain on your side, and "parameterisation" available on our side.
Cheers,
Michel