rspec/rules/S1192/tsql/rule.adoc
2023-10-11 11:41:24 +02:00

51 lines
680 B
Plaintext

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[]