rspec/rules/S2796/rpg/rule.adoc

55 lines
1.1 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Even if there's no data to be returned from a procedure, each procedure should at least return a boolean to indicate when procedure execution failed, so callers can respond accordingly.
=== 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
----
D MyProc PI
D param1 10A const
/free
// do work...
return; // Noncompliant
/end-free
----
=== 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
----
D MyProc PI N
D param1 10A const
/free
// do work...
return *ON;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Return something from this procedure.
'''
== Comments And Links
(visible only on this page)
=== on 2 Apr 2015, 18:55:05 Ann Campbell wrote:
http://www.bmeyers.net/faqs/14-tips/32-rpg-iv-style?start=2
=== on 16 Apr 2015, 09:33:33 Pierre-Yves Nicolas wrote:
\[~ann.campbell.2] I would not activate this rule by default, especially with a critical severity.
endif::env-github,rspecator-view[]