class RubyCritic::RevisionComparator

def initialize(paths)

def initialize(paths)
  @paths = paths
end

def load_cached_analysed_modules

def load_cached_analysed_modules
  Serializer.new(revision_file).load if File.file?(revision_file)
end

def revision_file

def revision_file
  @revision_file ||= File.join(
    Config.root,
    SNAPSHOTS_DIR_NAME,
    VERSION,
    Digest::MD5.hexdigest(Marshal.dump(@paths)),
    Config.source_control_system.head_reference
  )
end

def statuses=(analysed_modules_now)

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