Class: Rubycritic::Turbulence

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

Instance Method Summary collapse

Constructor Details

#initialize(paths, source_control_system) ⇒ Turbulence

Returns a new instance of Turbulence.



7
8
9
10
# File 'lib/rubycritic/turbulence.rb', line 7

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

Instance Method Details

#churnObject



22
23
24
# File 'lib/rubycritic/turbulence.rb', line 22

def churn
  @churn ||= Analyser::Churn.new(@paths, @source_control_system).churn
end

#complexityObject



26
27
28
# File 'lib/rubycritic/turbulence.rb', line 26

def complexity
  @complexity ||= QualityAdapter::Flog.new(@paths).complexity
end

#dataObject



12
13
14
15
16
17
18
19
20
# File 'lib/rubycritic/turbulence.rb', line 12

def data
  @paths.zip(churn, complexity).map do |path_info|
    {
      :name => path_info[0],
      :x => path_info[1],
      :y => path_info[2]
    }
  end
end