class RuboCop::Cop::Style::TernaryParentheses

def complex_condition?(condition)

complex expressions within it.
If the condition is parenthesized we recurse and check for any
def complex_condition?(condition)
  if condition.begin_type?
    condition.to_a.any? { |x| complex_condition?(x) }
  else
    !non_complex_expression?(condition)
  end
end