rspec/rules/S1475/cobol/rule.adoc

62 lines
803 B
Plaintext
Raw Normal View History

Any statement after a ``++STOP RUN++`` or ``++GOBACK++`` is unreachable and therefore dead code which should be removed.
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,cobol]
----
PARAGRAPH1.
MOVE A TO B.
STOP RUN.
MOVE B TO C.
----
or
2022-02-04 17:28:24 +01:00
[source,cobol]
----
PARAGRAPH1.
MOVE A TO B.
GOBACK.
MOVE B TO C.
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,cobol]
----
PARAGRAPH1.
MOVE A TO B.
MOVE B TO C.
STOP RUN.
----
or
2022-02-04 17:28:24 +01:00
[source,cobol]
----
PARAGRAPH1.
MOVE A TO B.
MOVE B TO C.
GOBACK.
----
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[]