rspec/rules/S134/rpg/rule.adoc

40 lines
756 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
Nested ``++CASxx++``, ``++DO++``, ``++DOU++``, ``++DOW++``, ``++DOUxx++``, ``++DOWxx++``, ``++FOR++``, ``++IF++``, ``++IFxx++``, ``++MONITOR++`` and ``++SELECT++`` statements is a key ingredient for making what's known as "Spaghetti code".
2021-02-02 15:02:10 +01:00
2020-06-30 12:47:33 +02:00
Such code is hard to read, refactor and therefore maintain.
== Noncompliant Code Example
With the default threshold of 3:
2020-06-30 12:47:33 +02:00
----
IF A <> B
IF B <> C
DOW B <> A
IF A <> D
...
ENDIF
ENDDO
ENDIF
ENDIF
----
----
if a <> b;
if b <> c;
dow b <> a;
if a <> d;
...
endif;
enddo;
endif;
endif;
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]