Class: RubyCritic::RevisionComparator

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/revision_comparator.rb

Constant Summary collapse

SNAPSHOTS_DIR_NAME =
'snapshots'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ RevisionComparator

Returns a new instance of RevisionComparator.


13
14
15
# File 'lib/rubycritic/revision_comparator.rb', line 13

def initialize(paths)
  @paths = paths
end

Instance Method Details

#set_statuses(analysed_modules_now) ⇒ Object


17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rubycritic/revision_comparator.rb', line 17

def set_statuses(analysed_modules_now)
  if Config.source_control_system.revision?
    analysed_modules_before = load_cached_analysed_modules
    if analysed_modules_before
      SmellsStatusSetter.set(
        analysed_modules_before.flat_map(&:smells),
        analysed_modules_now.flat_map(&:smells)
      )
    end
  end
  analysed_modules_now
end