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, delegation_n_plus_one: Detectors::DelegationNPlusOne, decorator_n_plus_one: Detectors::DecoratorNPlusOne, scope_chain_n_plus_one: Detectors::ScopeChainNPlusOne }.freeze
Instance Attribute Summary collapse
-
#association_preloads ⇒ Object
readonly
Returns the value of attribute association_preloads.
-
#delegation_maps ⇒ Object
readonly
Returns the value of attribute delegation_maps.
-
#issues ⇒ Object
readonly
Returns the value of attribute issues.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#scope_maps ⇒ Object
readonly
Returns the value of attribute scope_maps.
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.
22 23 24 25 26 27 28 |
# File 'lib/eager_eye/analyzer.rb', line 22 def initialize(paths: nil) @paths = Array(paths || EagerEye.configuration.app_path) @issues = [] @association_preloads = {} @delegation_maps = {} @scope_maps = {} end |
Instance Attribute Details
#association_preloads ⇒ Object (readonly)
Returns the value of attribute association_preloads.
20 21 22 |
# File 'lib/eager_eye/analyzer.rb', line 20 def association_preloads @association_preloads end |
#delegation_maps ⇒ Object (readonly)
Returns the value of attribute delegation_maps.
20 21 22 |
# File 'lib/eager_eye/analyzer.rb', line 20 def delegation_maps @delegation_maps end |
#issues ⇒ Object (readonly)
Returns the value of attribute issues.
20 21 22 |
# File 'lib/eager_eye/analyzer.rb', line 20 def issues @issues end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
20 21 22 |
# File 'lib/eager_eye/analyzer.rb', line 20 def paths @paths end |
#scope_maps ⇒ Object (readonly)
Returns the value of attribute scope_maps.
20 21 22 |
# File 'lib/eager_eye/analyzer.rb', line 20 def scope_maps @scope_maps end |
Instance Method Details
#run ⇒ Object
30 31 32 33 34 35 |
# File 'lib/eager_eye/analyzer.rb', line 30 def run @issues = [] ruby_files.each { |file_path| analyze_file(file_path) } @issues end |