Class: Watchr::FlogMetric::Report

Inherits:
Flog
  • Object
show all
Defined in:
lib/watchr/metrics/flog/report.rb

Overview

Seattle.rb Flog report.

Instance Method Summary collapse

Constructor Details

#initialize(files) ⇒ Report

Generate flog report for a given files.

Parameters:

  • Array (Array)

    of file paths.



17
18
19
20
21
22
# File 'lib/watchr/metrics/flog/report.rb', line 17

def initialize(files)
  super(:continue => true)

  flog(files)
  process_result
end

Instance Method Details

#classesArray.<FlogReportClass>

Get list of class reports.

Returns:



38
39
40
# File 'lib/watchr/metrics/flog/report.rb', line 38

def classes
  @classes
end

#classes_by_file(file) ⇒ Object



42
43
44
# File 'lib/watchr/metrics/flog/report.rb', line 42

def classes_by_file(file)
  classes.find_all {|klass| klass.file == file}
end

#total_scoreNumber

Get total complexity score.

Returns:

  • (Number)

    Score.



29
30
31
# File 'lib/watchr/metrics/flog/report.rb', line 29

def total_score
  (10 * total).round / 10.0
end