Modify rule S3358: Add examples for T-SQL (#1501)

This commit is contained in:
nicolas-gauthier-sonarsource 2023-01-16 16:02:44 +01:00 committed by GitHub
parent dc26f15566
commit 0979a5000c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,9 @@
== Compliant Solution
[source,sql]
----
IF @status = 'RUNNING'
SELECT 'Running';
ELSE
SELECT IIF(@hasError, 'Failed', 'Succeeded');
----

View File

@ -0,0 +1,6 @@
== Noncompliant Code Example
[source,sql]
----
SELECT IIF(@status = 'RUNNING', 'Running', IIF(@hasError, 'Failed', 'Succeeded')) -- Noncompliant
----

View File

@ -1,4 +1,8 @@
include::../rule.adoc[] include::../description.adoc[]
include::noncompliant.adoc[]
include::compliant.adoc[]
ifdef::env-github,rspecator-view[] ifdef::env-github,rspecator-view[]