Class: EagerEye::Detectors::PluckToArray

Inherits:
Base
  • Object
show all
Includes:
Concerns::NonArSourceDetector
Defined in:
lib/eager_eye/detectors/pluck_to_array.rb

Overview

rubocop:disable Metrics/ClassLength

Constant Summary collapse

SMALL_COLLECTIONS =
%w[tags settings options categories roles permissions statuses types priorities].freeze
SCOPING_METHODS =
%i[where not limit offset order group having distinct
joins left_joins left_outer_joins includes preload eager_load
lock select from references unscope merge or rewhere reorder regroup
in_order_of].freeze

Constants included from Concerns::NonArSourceDetector

Concerns::NonArSourceDetector::NON_AR_RECEIVERS, Concerns::NonArSourceDetector::NON_DB_SOURCE_METHODS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

default_severity

Class Method Details

.detector_nameObject



16
17
18
# File 'lib/eager_eye/detectors/pluck_to_array.rb', line 16

def self.detector_name
  :pluck_to_array
end

Instance Method Details

#detect(ast, file_path) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/eager_eye/detectors/pluck_to_array.rb', line 20

def detect(ast, file_path)
  @issues = []
  @file_path = file_path
  reset_tracking_variables

  return @issues unless ast

  collect_all_info(ast)
  check_ast(ast)

  @issues
end