rspec/rules/S3626/plsql/rule.adoc

33 lines
731 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
Jump statements, such as ``++RETURN++`` and ``++CONTINUE++`` let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes.
2020-06-30 12:48:39 +02:00
== Noncompliant Code Example
----
CREATE PROCEDURE print_numbers AS
BEGIN
FOR i in 1..4 LOOP
DBMS_OUTPUT.PUT_LINE(i);
CONTINUE; -- Noncompliant
END LOOP;
RETURN; -- Noncompliant
END;
----
== Compliant Solution
----
CREATE PROCEDURE print_numbers AS
BEGIN
FOR i in 1..4 LOOP
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]