rspec/rules/S1289/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

45 lines
967 B
Plaintext

== Why is this an issue?
An unused data item block is dead code. Such data item blocks should be removed to increase the maintainability of the program.
=== Noncompliant code example
[source,cobol]
----
IDENTIFICATION DIVISION.
PROGRAM-ID. foo.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 PERSON. *> Compliant as sub data item FIRST_NAME is used
02 FIRST_NAME PIC X(21).
02 LAST_NAME PIC X(21).
01 ADDR. *> Noncompliant as no data item in this block is used
02 STREET PIC X(50).
02 TOWN PIC X(50).
PROCEDURE DIVISION.
MOVE "John" TO FIRST_NAME.
----
=== Exceptions
``++FILLER++`` top level data items and top level data items which have sub data items with a ``++VALUE++`` clause are not checked by this rule.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
This data item block "XXXX" is unused and so should be removed.
endif::env-github,rspecator-view[]