Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
PhilippSalvisberg opened this issue Sep 30, 2022 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@PhilippSalvisberg
Copy link
Collaborator

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.

@PhilippSalvisberg
Copy link
Collaborator Author

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.

@PhilippSalvisberg PhilippSalvisberg added this to the v4.4 milestone Jul 21, 2023
@PhilippSalvisberg PhilippSalvisberg modified the milestones: v4.4, v4.3 Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant