Class: RubyMaat::App

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_maat/app.rb

Overview

Main application orchestration This is the Ruby equivalent of code-maat.app.app namespace

Constant Summary collapse

SUPPORTED_VCS =
%w[git git2 svn hg p4 tfs].freeze
SUPPORTED_ANALYSES =
{
  "authors" => RubyMaat::Analysis::Authors,
  "revisions" => RubyMaat::Analysis::Entities,
  "coupling" => RubyMaat::Analysis::LogicalCoupling,
  "soc" => RubyMaat::Analysis::SumOfCoupling,
  "summary" => RubyMaat::Analysis::Summary,
  "identity" => RubyMaat::Analysis::Identity,
  "abs-churn" => RubyMaat::Analysis::Churn::Absolute,
  "author-churn" => RubyMaat::Analysis::Churn::ByAuthor,
  "entity-churn" => RubyMaat::Analysis::Churn::ByEntity,
  "entity-ownership" => RubyMaat::Analysis::Churn::Ownership,
  "main-dev" => RubyMaat::Analysis::Churn::MainDeveloper,
  "refactoring-main-dev" => RubyMaat::Analysis::Churn::RefactoringMainDeveloper,
  "entity-effort" => RubyMaat::Analysis::Effort::ByRevisions,
  "main-dev-by-revs" => RubyMaat::Analysis::Effort::MainDeveloperByRevisions,
  "fragmentation" => RubyMaat::Analysis::Effort::Fragmentation,
  "communication" => RubyMaat::Analysis::Communication,
  "messages" => RubyMaat::Analysis::CommitMessages,
  "age" => RubyMaat::Analysis::CodeAge
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ App

Returns a new instance of App.



36
37
38
39
# File 'lib/ruby_maat/app.rb', line 36

def initialize(options = {})
  @options = options
  validate_options!
end

Class Method Details

.analysis_namesObject



32
33
34
# File 'lib/ruby_maat/app.rb', line 32

def self.analysis_names
  SUPPORTED_ANALYSES.keys.sort.join(", ")
end

Instance Method Details

#runObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/ruby_maat/app.rb', line 41

def run
  # Parse VCS log file
  parser = create_parser
  change_records = parser.parse

  # Apply data transformations
  change_records = apply_grouping(change_records)
  change_records = apply_temporal_grouping(change_records)
  change_records = apply_team_mapping(change_records)

  # Convert to dataset
  dataset = Dataset.from_changes(change_records)

  # Run analysis
  analysis = create_analysis
  results = analysis.analyze(dataset, @options)

  # Output results
  output_handler = create_output_handler
  output_handler.write(results)
rescue => e
  handle_error(e)
end