rspec/rules/S1145/plsql/rule.adoc

42 lines
880 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-01-27 13:42:22 +01:00
``++IF++`` statements with conditions that are always false have the effect of making blocks of code non-functional. This can be useful during debugging, but should not be checked in. ``++IF++`` statements with conditions that are always true are completely redundant, and make the code less readable. In either case, unconditional ``++IF++`` statements should be removed.
2020-06-30 12:47:33 +02:00
=== Noncompliant code example
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,sql]
2020-06-30 12:47:33 +02:00
----
IF TRUE THEN
do_something;
END IF;
IF FALSE THEN
do_something_else;
END IF;
----
=== Compliant solution
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,sql]
2020-06-30 12:47:33 +02:00
----
do_something;
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]