Skip to content

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

Closed
@PhilippSalvisberg

Description

@PhilippSalvisberg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions