Trivadis/plsql-and-sql-coding-guidelines

G-1050: Make guideline less strict by using a threshold parameter

PhilippSalvisberg opened this issue · 1 comments

As mentioned in #179, the guideline is too strict IMO. SonarSource defines a similar rule plsql:S1192 - String literals should not be duplicated. For this rule a threshold can be defined as parameter.

I like the idea of using parameters in rules. This concept can be applied in various rules (for example to configure the prefix and suffix for naming conventions).

We should start to introduce the the concept of parameters in the guidelines. In this case a threshold with the meaning Number of times a literals must be duplicated to trigger an issue. The default will be 0 will be identical to the current behavior. The db* CODECOP tool suite needs to be enhanced to support this threshold. This gives the users a better option than disabling to complete guideline.

We should change the description of the rule. The rule is violated when the number of occurrences of literal is greater than the threshold. The default threshold should be 2. As a result, we should change the bad example to have two identical literals.