The idea behind this rule is to avoid the overused of lambdas and streams. In this non-compliant example,
it’s easy overlook that this one is nested. In a even more complicated case, it will only get harder to understand.
About that threshold, it really depends on which intermediate stream operations are used. For example
map(...) are quite easy to follow up, if the conditions or method are kept simple (lambdas should be short as possible, ideally a method reference). On the other hand using
flatmap(...) will make it much more harder to follow.
Since we aren’t really expert in this field, maybe you could try to figure out when this certain threshold is reach. For example using
filter() with a simple lambda condition gives 1 point. Using
filter() with a more complex lambda gives 3 Points. After reaching a certain number of points you could raise an issue.