Class: Skunk::Generator::Console::Simple
- Inherits:
-
Object
- Object
- Skunk::Generator::Console::Simple
- Defined in:
- lib/skunk/generators/console/simple.rb
Overview
Generates a console report for the analysed modules.
Constant Summary collapse
- HEADINGS =
%w[file skunk_score churn_times_cost churn cost coverage].freeze
- HEADINGS_WITHOUT_FILE =
HEADINGS - %w[file]
- HEADINGS_WITHOUT_FILE_WIDTH =
padding
HEADINGS_WITHOUT_FILE.size * 17
- TEMPLATE =
ERB.new(<<~TEMPL <%= _ttable %> SkunkScore Total: <%= total_skunk_score %> Modules Analysed: <%= analysed_modules_count %> SkunkScore Average: <%= skunk_score_average %> <% if worst %>Worst SkunkScore: <%= worst.skunk_score %> (<%= worst.pathname %>)<% end %> Generated with Skunk v<%= Skunk::VERSION %> TEMPL )
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(analysed_modules) ⇒ Simple
constructor
A new instance of Simple.
- #render ⇒ Object
Constructor Details
#initialize(analysed_modules) ⇒ Simple
Returns a new instance of Simple.
11 12 13 |
# File 'lib/skunk/generators/console/simple.rb', line 11 def initialize(analysed_modules) @analysed_modules = analysed_modules end |
Class Method Details
.format_hash_row(file_hash) ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/skunk/generators/console/simple.rb', line 79 def self.format_hash_row(file_hash) [ file_hash[:file], file_hash[:skunk_score], file_hash[:churn_times_cost], file_hash[:churn], file_hash[:cost], file_hash[:coverage] ] end |