rspec/rules/S1192/rpg/rule.adoc

67 lines
1.5 KiB
Plaintext
Raw Normal View History

2023-10-11 11:41:24 +02:00
include::../rule.adoc[]
2023-10-11 11:41:24 +02:00
=== Code examples
2020-06-30 12:47:33 +02:00
2023-10-11 11:41:24 +02:00
==== Noncompliant code example
2020-06-30 12:47:33 +02:00
With the default threshold of 3:
2023-10-11 11:41:24 +02:00
[source,rpg,diff-id=1,diff-type=noncompliant]
2020-06-30 12:47:33 +02:00
----
C MOVEL 'CLEAR' W1CLR Noncompliant
C MOVEL '*DECOD' W1DCDE
C MOVEL '*ERROR' W1ERR
C MOVEL '*EXIT ' W1EXIT
C MOVEL 'CLEAR' W1FIRT
C MOVEL 'CLEAR' W1HELP
----
2023-10-11 11:41:24 +02:00
[source,rpg,diff-id=2,diff-type=noncompliant]
2020-06-30 12:47:33 +02:00
----
/free
W1CLR = 'CLEAR'; // Noncompliant
W1FIRT = 'CLEAR';
W1HELP = 'CLEAR';
/end-free
----
2023-10-11 11:41:24 +02:00
==== Compliant solution
2020-06-30 12:47:33 +02:00
2023-10-11 11:41:24 +02:00
[source,rpg,diff-id=1,diff-type=compliant]
2020-06-30 12:47:33 +02:00
----
D W0Clr C CONST('CLEAR')
C MOVEL W0Clr W1CLR
C MOVEL '*DECOD' W1DCDE
C MOVEL '*ERROR' W1ERR
C MOVEL '*EXIT ' W1EXIT
C MOVEL W0Clr W1FIRT
C MOVEL W0Clr W1HELP
----
2023-10-11 11:41:24 +02:00
[source,rpg,diff-id=2,diff-type=compliant]
2020-06-30 12:47:33 +02:00
----
D W0Clr C CONST('CLEAR')
/free
W1CLR = W0Clr;
W1FIRT = W0Clr;
W1HELP = W0Clr;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
include::../highlighting.adoc[]
'''
endif::env-github,rspecator-view[]