rspec/rules/S1005/flex/rule.adoc
2022-02-04 16:28:24 +00:00

42 lines
584 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,flex]
----
function func1() { // Noncompliant - there are two points of exit
if (false) {
return;
}
}
function func2() { // Noncompliant - there are two points of exit
if (a > 0) {
return 0;
}
return -1;
}
----
== Compliant Solution
[source,flex]
----
function func1() {
return;
}
function func2() {
}
function func3();
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]