rspec/rules/S1629/rpg/rule.adoc

58 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
While ``++END++`` will adequately close a statement, it is less clear than the use of the relevant, statement-specific ``++ENDxx++``. Thus, the statement-specific version is preferred to facilitate code maintenance and enhance clarity.
This rule is applied to the following operations: ``++CASxx++``, ``++DO++``, ``++DOU++``, ``++DOUxx++``, ``++DOW++``, ``++DOWxx++``, ``++FOR++``, ``++IF++``, ``++IFxx++`` and ``++SELECT++`` groups.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
C W0PKEX DOUEQ W0ON
...
C END
C W0PKEX IFEQ W0ON
...
C END
----
----
/free
if x = 1;
...
end;
/end-free
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
C W0PKEX DOUEQ W0ON
...
C ENDDO
C W0PKEX IFEQ W0ON
...
C ENDIF
----
----
/free
if x = 1;
...
endif;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]