diff --git a/lib/rubocop/cop/performance/detect.rb b/lib/rubocop/cop/performance/detect.rb index 1cee1e8d93..8367c4db79 100644 --- a/lib/rubocop/cop/performance/detect.rb +++ b/lib/rubocop/cop/performance/detect.rb @@ -8,9 +8,12 @@ module Performance # `detect` instead. # # @safety - # This cop is unsafe because is has known compatibility issues with `ActiveRecord` and other - # frameworks. `ActiveRecord` does not implement a `detect` method and `find` has its own - # meaning. Correcting `ActiveRecord` methods with this cop should be considered unsafe. + # This cop is unsafe because is assumes the class implements the + # `Enumerable` interface, but can't reliably detect this. This creates + # known compatibility issues with `Hash`, `ActiveRecord` and other + # frameworks. `Hash` and `ActiveRecord` do not implement a `detect` + # method and `find` has its own meaning. Correcting `Hash` and + # `ActiveRecord` methods with this cop should be considered unsafe. # # @example # # bad