Labeled blocks are useful, especially when the code is badly indented, to help maintainers match the beginning and ending of each block. When
blocks are nested, labeling them can improve the code’s readability. This rule detects nested block which do not have a start label.
Noncompliant code example
BEGIN -- Compliant, this is not a nested block
NULL;
END;
/
BEGIN
BEGIN -- Noncompliant; this nested block has no label
NULL;
END;
END;
/
BEGIN
BEGIN -- Noncompliant; this nested block has only an end label
NULL;
END myBlockLabel1;
<<myBlockLabel2>> -- Compliant
BEGIN
NULL;
END;
END;
/
Compliant solution
BEGIN
NULL;
END;
/
BEGIN
BEGIN myBlockLabel0
NULL;
END myBlockLabel0;
END;
/
BEGIN
BEGIN myBlockLabel1
NULL;
END myBlockLabel1;
<<myBlockLabel2>>
BEGIN
NULL;
END;
END;
/