Class: Rubycritic::Analyser::Churn

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

Instance Method Summary collapse

Constructor Details

#initialize(analysed_files, source_control_system) ⇒ Churn

Returns a new instance of Churn.



5
6
7
8
# File 'lib/rubycritic/analysers/churn.rb', line 5

def initialize(analysed_files, source_control_system)
  @analysed_files = analysed_files
  @source_control_system = source_control_system
end

Instance Method Details

#churnObject



10
11
12
13
14
15
# File 'lib/rubycritic/analysers/churn.rb', line 10

def churn
  @analysed_files.each do |analysed_file|
    analysed_file.churn = @source_control_system.revisions_count(analysed_file.path)
    analysed_file.committed_at = @source_control_system.date_of_last_commit(analysed_file.path)
  end
end