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-4220 violates rule G-1050 in bad and good example #105

Closed
PhilippSalvisberg opened this issue Mar 19, 2021 · 0 comments
Closed

G-4220 violates rule G-1050 in bad and good example #105

PhilippSalvisberg opened this issue Mar 19, 2021 · 0 comments

Comments

@PhilippSalvisberg
Copy link
Collaborator

In this case I'm not sure if we should change the example when I look the examples version in v3.6:

BEGIN
   SELECT DECODE(dummy, a, x 
                      , b, y
                      , c, z
                      , 0)
     INTO l_result
     FROM dual;
END;
/
BEGIN
   l_result := CASE dummy
                  WHEN a THEN x
                  WHEN b THEN y
                  WHEN c THEN z
                  ELSE 0
               END;
END;
/

Maybe we should think about making rule G-1050 more precise and define where literals are acceptable. It's one of those checks that throws tons of violations in any code I analyze. As a result I typically disable the rule completely.

In any case we should try to avoid violating any of our own guidelines in the good example and try to violate only one guideline in the bad example.

@kibeha kibeha closed this as completed in a500eed Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant