rspec/rules/S1624/rpg/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

42 lines
1.0 KiB
Plaintext

== Why is this an issue?
Using a unique ``++KLIST++`` to access files ensures that the correct key is used at all times and creates a standard method of accessing the data throughout the code, simplifying maintenance and improving readability.
This rule flags non-compliant instances of ``++CHAIN++``, ``++DELETE++``, ``++READE++``, ``++READPE++``, ``++SETGT++``, and ``++SETLL++`` operations.
=== Noncompliant code example
[source,rpg]
----
C 'D001 B' CHAIN KYCUSTN 20
...
C DEPT CHAIN KYCUSTN 20
----
=== Compliant solution
[source,rpg]
----
C DEPTKY KLIST
C KFLD DEPT
C KFLD SHIFT
C DEPTKY CHAIN KYCUSTN 20
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Rewrite this statement to use a "KLIST"
endif::env-github,rspecator-view[]