2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2021-04-28 16:49:39 +02:00
|
|
|
Aligning opening and ending words of statements is critical to keep the code readable, especially when blocks contain nested statements.
|
|
|
|
|
|
|
|
|
|
|
|
For ``++IF++`` statements, this rule also checks the alignment of the ``++ELSE++`` word.
|
|
|
|
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Noncompliant code example
|
2021-04-28 16:49:39 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,cobol]
|
2021-04-28 16:49:39 +02:00
|
|
|
----
|
|
|
|
IF SOME-STATUS = 1
|
|
|
|
DISPLAY something
|
|
|
|
END-IF. *> Noncompliant
|
|
|
|
----
|
|
|
|
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Compliant solution
|
2021-04-28 16:49:39 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,cobol]
|
2021-04-28 16:49:39 +02:00
|
|
|
----
|
|
|
|
IF SOME-STATUS = 1
|
|
|
|
DISPLAY something
|
|
|
|
END-IF.
|
|
|
|
----
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2021-09-20 15:38:42 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
=== Message
|
|
|
|
|
|
|
|
Align "ELSE" with its corresponding "IF" at line 18.
|
|
|
|
|
|
|
|
Align "END-REWRITE" with its corresponding "REWRITE" at line 37.
|
|
|
|
|
|
|
|
|
|
|
|
=== Parameters
|
|
|
|
|
|
|
|
.evaluate
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to EVALUATE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.call
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to CALL statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.accept
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to ACCEPT statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.execDli
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to EXECDLI statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.return
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to RETURN statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.divide
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to DIVIDE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.xmlParse
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to XMLPARSE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.display
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to DISPLAY statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.multiply
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to MULTIPLY statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.perform
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to PERFORM statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.add
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to ADD statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.subtract
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to SUBTRACT statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.rewrite
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to REWRITE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.search
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to SEARCH statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.start
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to START statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.if
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to IF statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.string
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to STRING statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.delete
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to DELETE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.write
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to WRITE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.read
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to READ statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.compute
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to COMPUTE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.unstring
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to UNSTRING statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.xmlGenerate
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to XMLGENERATE statements, 'false' otherwise
|
|
|
|
****
|
|
|
|
.move
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
true
|
|
|
|
----
|
|
|
|
|
|
|
|
'true' to apply the rule to MOVE statements, 'false' otherwise
|
|
|
|
****
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|