Module: Seethe

Defined in:
lib/seethe.rb,
lib/seethe/churn.rb,
lib/seethe/version.rb,
lib/seethe/complexity.rb

Defined Under Namespace

Classes: Churn, Complexity

Constant Summary collapse

VERSION =
"1.0.0".freeze
RELEASE_DATE =
"2015-08-04".freeze

Class Method Summary collapse

Class Method Details

.chdir(path = ".") ⇒ Object



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

def chdir(path = ".")
  Dir.chdir(File.expand_path(path))
end

.complect(path, flog_cutoff, churn_cutoff) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/seethe.rb', line 21

def complect(path, flog_cutoff, churn_cutoff)
  complexity = Seethe::Complexity.new(path, flog_cutoff).process
  churn = Seethe::Churn.new(complexity.keys, churn_cutoff).process
  matches = complexity.inject({}) do |memo, (k,v)|
    memo[k] = { churn: churn[k], complexity: v } if churn.has_key? k
    memo
  end
end

.glob_directory(path) ⇒ Object



17
18
19
# File 'lib/seethe.rb', line 17

def glob_directory(path)
  Dir.glob(File.join(path, "**/*.*rb"))
end

.inspectObject



9
10
11
# File 'lib/seethe.rb', line 9

def inspect
  "Seethe #{Seethe::VERSION} on #{Seethe::RELEASE_DATE}"
end

.report(path, flog_cutoff, churn_cutoff) ⇒ Object



30
31
32
33
34
# File 'lib/seethe.rb', line 30

def report(path, flog_cutoff, churn_cutoff)
  complect(path, flog_cutoff, churn_cutoff).each do |k,v|
    puts "#{k}\t#{v}"
  end
end