2023-05-03 11:06:20 +02:00
== Why is this an issue?
2021-04-28 16:49:39 +02:00
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.
2021-04-28 18:08:03 +02:00
2021-06-02 20:44:38 +02:00
2021-06-03 09:05:38 +02:00
ifdef::env-github,rspecator-view[]
2021-09-20 15:38:42 +02:00
'''
== Implementation Specification
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== 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
****
2021-09-20 15:38:42 +02:00
2021-06-08 15:52:13 +02:00
'''
2021-06-02 20:44:38 +02:00
== Comments And Links
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== 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
2021-06-03 09:05:38 +02:00
endif::env-github,rspecator-view[]