rspec/rules/S5612/java/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
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.
2023-05-25 14:18:12 +02:00

43 lines
937 B
Plaintext

== Why is this an issue?
Lambdas (introduced with Java 8) are a very convenient and compact way to inject a behavior without having to create a dedicated class or method. But those lambdas should be used only if the behavior to be injected can be defined in a few lines of code, otherwise the source code can quickly become unreadable.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Reduce this lambda number of lines from {} to at most {}, or make it a named class or method.
=== Parameters
.Max
****
----
20
----
Maximum allowed lines of code in a lambda
****
'''
== Comments And Links
(visible only on this page)
=== relates to: S1188
=== on 7 Nov 2019, 15:19:40 Michael Gumowski wrote:
Splitting RSPEC-1188 for java in two distinct rules:
* RSPEC-1188 targets ONLY anonymous classes
* RSPEC-5612 targets ONLY lambdas
endif::env-github,rspecator-view[]