rspec/rules/S1729/cobol/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

40 lines
1014 B
Plaintext

== Why is this an issue?
Using more than one ``++OF++`` clause to access a data item can quickly decrease the readability of the source code. Either some ``++OF++`` clauses are optional and should be removed, or there are too many intersections between several data structures and those intersections should be removed.
=== Noncompliant code example
[source,cobol]
----
01 EMPLOYEE.
05 MOTHER-IN-LAW.
10 NAME PIC X(20).
05 FATHER-IN-LAW.
10 NAME PIC X(20).
...
01 CUSTOMER.
05 MOTHER-IN-LAW.
10 NAME PIC X(20).
05 FATHER-IN-LAW.
10 NAME PIC X(20).
...
MOVE MY_VALUE TO NAME OF MOTHER-IN-LAW OF CUSTOMER
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* Refactor the "YYY" data structure to be able to access to "XXXX" with at most one "OF" clause
* Remove the optional "OF" clauses from this qualified data name to access to "XXXX" with at most one "OF" clause
endif::env-github,rspecator-view[]