rspec/rules/S2538/plsql/rule.adoc

45 lines
1.7 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
``++RETURN++`` should not be used from within a ``++FOR++`` or ``++WHILE++`` loop. Doing so can quickly turn your code into "spaghetti code". Such code is hard to read, refactor and therefore to maintain.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this "RETURN" statement.
'''
== Comments And Links
(visible only on this page)
=== on 3 Feb 2015, 19:10:19 Ann Campbell wrote:
\[~dinesh.bolkensteyn] can you give me a code sample?
=== on 11 May 2015, 11:51:14 Dinesh Bolkensteyn wrote:
I don't think this is a very valuable rule [~ann.campbell.2]
We already have other rules (such as the one limiting the nesting of language constructs) which spot spaghetti code.
=== on 11 May 2015, 14:08:55 Ann Campbell wrote:
this is frustrating [~dinesh.bolkensteyn]. In February, I could have told you were this rule idea came from; I know I didn't pull it out of thin air. Today, I can only close the ticket.
=== on 11 May 2015, 14:19:54 Dinesh Bolkensteyn wrote:
Well [~ann.campbell.2] this rule actually comes from the plugin :) it is implemented with the legacy key ``++ReturnInLoop++``
=== on 12 May 2015, 11:17:39 Ann Campbell wrote:
does that mean you want to deprecate and remove the rule from the plugin [~dinesh.bolkensteyn]?
=== on 12 May 2015, 11:33:29 Dinesh Bolkensteyn wrote:
Yes I guess so [~ann.campbell.2] - I've done a quick search yesterday on this... and didn't find anything confirming that this indeed is a bad practice.
=== on 12 May 2015, 17:14:02 Ann Campbell wrote:
Not considered a valuable rule. Will be removed from single implementing plugin: PL/SQL.
endif::env-github,rspecator-view[]