include::../rule.adoc[]

=== Code examples

==== Noncompliant code example

With the default threshold of 3:

[source,sql,diff-id=1,diff-type=noncompliant]
----
IF @x='Yes'
  SELECT ...
    FROM ...
    WHERE field='Yes'
...
...
IF @x='Yes'
  ...
----

==== Compliant solution

[source,sql,diff-id=1,diff-type=compliant]
----
DECLARE @Yes VARCHAR(3) = 'Yes'
IF @x=@Yes
  SELECT ...
    FROM ...
    WHERE field=@Yes
...
...
IF @x=@Yes
  ...
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

include::../parameters.adoc[]

include::../highlighting.adoc[]

'''

endif::env-github,rspecator-view[]
