I think Rubocop got confused by the method definitions inside an `if`.