class RuboCop::Cop::Style::RedundantArrayFlatten

Checks for redundant calls of ‘Array#flatten`.

‘Array#join` joins nested arrays recursively, so flattening an array beforehand is redundant.

@safety

Cop is unsafe because the receiver of `flatten` method might not
be an `Array`, so it's possible it won't respond to `join` method,
or the end result would be different.
Also, if the global variable `$,` is set to a value other than the default `nil`,
false positives may occur.

@example

# bad
x.flatten.join
x.flatten(1).join

# good
x.join