Skip to content

Simplify G-1050 and related examples #206

Closed
@PhilippSalvisberg

Description

@PhilippSalvisberg

This version of G-1050 describes the following exceptions:

  1. Literals in logger calls
  2. Literals in views
  3. Literals that are used less than 3 times in a file

Number 2 and number 3 have been introduced after the release of version 4.2. After some consideration this rule is

a) too complicated and
b) not stringent.

For example, literals in views are okay, but not OK in SQL Scripts with insert statements? Additionally, the exclusion of views is based on some corner cases where a function wrapping a constant is leading to a bad execution plan.

To simplify the rule, let's state the following (replacing the last three paragraphs):

To avoid an extreme abundance of constants or false positives, a literal should not occur more than once within a file.

Furthermore the examples in the chapter "Language Usages" should simplified accordingly.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions