In S2184, we check any return in the body of a function for misuse, while we should exclude ones in a nested lambda or class since they are in another scope.
double compute() { long sum = List.of(1, 2, 3).stream().mapToLong(i -> { return i * i; }).sum(); return sum; }
- relates to
-
RSPEC-2184 Math operands should be cast before assignment
- Active
- links to