
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
50 lines
849 B
Plaintext
50 lines
849 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
With the default threshold of 3:
|
|
|
|
[source,python]
|
|
----
|
|
def fun(): # Noncompliant as there are 4 return statements
|
|
if condition1:
|
|
return True
|
|
elif condition2:
|
|
return False
|
|
else:
|
|
return True
|
|
return False
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
This [method|function] has n returns or yields, which is more than the m allowed.
|
|
|
|
|
|
include::../parameters.adoc[]
|
|
|
|
=== Highlighting
|
|
|
|
* Primary: on the function name
|
|
* Secondary: on ``++return++`` statements
|
|
message should be one of:
|
|
|
|
** "return" statement.
|
|
** "yield" statement.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|