rspec/rules/S1316/cobol/rule.adoc

262 lines
3.1 KiB
Plaintext
Raw Normal View History

== 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.
=== 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
----
=== 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.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== 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
****
endif::env-github,rspecator-view[]