rspec/rules/S2284/rpg/rule.adoc

63 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Free-format syntax is preferred because it is clearer, easier to write, and easier for newcomers to the language than fixed-format syntax.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
C IF A > 10
C EVAL B = 1
C ENDIF
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
/free
if A > 10;
B = 1;
endif;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Convert this calculation block to free-form syntax.
'''
== Comments And Links
(visible only on this page)
=== on 15 Dec 2014, 13:46:44 Ann Campbell wrote:
assigned to you for approval
=== on 15 Dec 2014, 14:17:18 Pierre-Yves Nicolas wrote:
Looks good to me.
I guess that rule should be fired for a block of lines of code rather than for individual lines. If that's the case, then we may have to use a linear remediation function.
=== on 15 Dec 2014, 14:49:53 Ann Campbell wrote:
Linear with offset based on the number of lines? What do you think [~pierre-yves.nicolas]?
5 min + 5min/line ?
For the noncompliant code example, that works out to 20min...
=== on 15 Dec 2014, 16:59:31 Pierre-Yves Nicolas wrote:
Ok. We should probably update the message to make it clear that the issue is on a block.
endif::env-github,rspecator-view[]