Class: EagerEye::Detectors::PluckToArray

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

default_severity

Class Method Details

.detector_nameObject



6
7
8
# File 'lib/eager_eye/detectors/pluck_to_array.rb', line 6

def self.detector_name
  :pluck_to_array
end

Instance Method Details

#detect(ast, file_path) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/eager_eye/detectors/pluck_to_array.rb', line 10

def detect(ast, file_path)
  @issues = []
  @file_path = file_path
  @pluck_variables = {}
  @map_id_variables = {}

  return @issues unless ast

  collect_pluck_assignments(ast)
  collect_map_id_assignments(ast)
  find_where_with_pluck_var(ast)

  @issues
end