Class: EagerEye::Analyzer
- Inherits:
-
Object
- Object
- EagerEye::Analyzer
- Defined in:
- lib/eager_eye/analyzer.rb
Constant Summary collapse
- DETECTOR_CLASSES =
{ loop_association: Detectors::LoopAssociation, serializer_nesting: Detectors::SerializerNesting, missing_counter_cache: Detectors::MissingCounterCache, custom_method_query: Detectors::CustomMethodQuery, count_in_iteration: Detectors::CountInIteration, callback_query: Detectors::CallbackQuery, pluck_to_array: Detectors::PluckToArray }.freeze
Instance Attribute Summary collapse
-
#association_preloads ⇒ Object
readonly
Returns the value of attribute association_preloads.
-
#issues ⇒ Object
readonly
Returns the value of attribute issues.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
-
#initialize(paths: nil) ⇒ Analyzer
constructor
A new instance of Analyzer.
- #run ⇒ Object
Constructor Details
#initialize(paths: nil) ⇒ Analyzer
Returns a new instance of Analyzer.
19 20 21 22 23 |
# File 'lib/eager_eye/analyzer.rb', line 19 def initialize(paths: nil) @paths = Array(paths || EagerEye.configuration.app_path) @issues = [] @association_preloads = {} end |
Instance Attribute Details
#association_preloads ⇒ Object (readonly)
Returns the value of attribute association_preloads.
17 18 19 |
# File 'lib/eager_eye/analyzer.rb', line 17 def association_preloads @association_preloads end |
#issues ⇒ Object (readonly)
Returns the value of attribute issues.
17 18 19 |
# File 'lib/eager_eye/analyzer.rb', line 17 def issues @issues end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
17 18 19 |
# File 'lib/eager_eye/analyzer.rb', line 17 def paths @paths end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 |
# File 'lib/eager_eye/analyzer.rb', line 25 def run @issues = [] collect_association_preloads analyze_files @issues end |