rspec/rules/S109/rpg/rule.adoc

47 lines
798 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 10:16:44 +02:00
Using a named constant to refer to an indicator makes the content of the field clearer, and therefore makes the code easier to read and maintain.
=== Noncompliant code example
2020-06-30 10:16:44 +02:00
2022-02-04 17:28:24 +01:00
[source,rpg]
2020-06-30 10:16:44 +02:00
----
/Free
If *In(25); // Noncompliant
// Process contents...
EndIf;
----
=== Compliant solution
2020-06-30 10:16:44 +02:00
2022-02-04 17:28:24 +01:00
[source,rpg]
2020-06-30 10:16:44 +02:00
----
D accountTotal c 25
/Free
If *In(accountTotal);
// Process contents...
EndIf;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use a named constant for this reference to XXX.
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]