
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
59 lines
946 B
Plaintext
59 lines
946 B
Plaintext
== Why is this an issue?
|
|
|
|
Using the same name for multiple purposes reduces the understandability of the code and might eventually lead to bugs.
|
|
|
|
|
|
This rule verifies that no label is reused in an inner scope.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,sql]
|
|
----
|
|
<<foo>>
|
|
DECLARE
|
|
a CONSTANT PLS_INTEGER := 0;
|
|
BEGIN
|
|
<<foo>> -- Noncompliant
|
|
DECLARE
|
|
b CONSTANT PLS_INTEGER := 42;
|
|
BEGIN
|
|
DBMS_OUTPUT.PUT_LINE('x = ' || foo.b); -- Confusing
|
|
END;
|
|
END;
|
|
/
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,sql]
|
|
----
|
|
<<foo>>
|
|
DECLARE
|
|
a CONSTANT PLS_INTEGER := 0;
|
|
BEGIN
|
|
<<bar>>
|
|
DECLARE
|
|
b CONSTANT PLS_INTEGER := 42;
|
|
BEGIN
|
|
DBMS_OUTPUT.PUT_LINE('x = ' || bar.b);
|
|
END;
|
|
END;
|
|
/
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Give a unique name to this identifier which was first declared at line X
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|