{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/1757","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1757/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1757/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1757/events","html_url":"https://github.com/bbatsov/rubocop/issues/1757","id":66321513,"number":1757,"title":"Problem with Performance/Detect","user":{"login":"bquorning","id":22333,"avatar_url":"https://avatars.githubusercontent.com/u/22333?v=3","gravatar_id":"","url":"https://api.github.com/users/bquorning","html_url":"https://github.com/bquorning","followers_url":"https://api.github.com/users/bquorning/followers","following_url":"https://api.github.com/users/bquorning/following{/other_user}","gists_url":"https://api.github.com/users/bquorning/gists{/gist_id}","starred_url":"https://api.github.com/users/bquorning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bquorning/subscriptions","organizations_url":"https://api.github.com/users/bquorning/orgs","repos_url":"https://api.github.com/users/bquorning/repos","events_url":"https://api.github.com/users/bquorning/events{/privacy}","received_events_url":"https://api.github.com/users/bquorning/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-04T13:39:51Z","updated_at":"2015-04-04T14:56:17Z","closed_at":null,"body":"On the latest master (933d084f7df1c68663db07f13e2d1a17b3e195b4), I tried this bit of code:\r\n```rb\r\nclass A\r\n  def find_all(arg)\r\n    [arg]\r\n  end\r\nend\r\n\r\nA.new.find_all(42).first\r\n```\r\n\r\nAnd got this offense: \r\n\r\n```\r\ntest.rb:7:7: C: Use find instead of find_all.first.\r\nA.new.find_all(42).first\r\n      ^^^^^^^^^^^^^^^^^^\r\n```\r\n\r\nNot all classes that define `#find_all` do also define an equivalent `#find` method. A more realistic example would be [`ActionView::Resolver`](https://github.com/rails/rails/blob/v4.2.1/actionview/lib/action_view/template/resolver.rb).\r\n\r\ncc @palkan @rrosenblum\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/89590679","html_url":"https://github.com/bbatsov/rubocop/issues/1757#issuecomment-89590679","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1757","id":89590679,"user":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"created_at":"2015-04-04T14:56:17Z","updated_at":"2015-04-04T14:56:17Z","body":"There's no real solution for this, but I doubt it's a big issue in practice. We wanted to address `#find_all` from Enumerable and we can't account for all the naming choices in 3rd party libs (Rails has so many bad ideas in that department). \r\n\r\nLike with any similar cop, the only thing one can in case of false positives is to disable the cop."}}