Sha256: 2dcf294b8436b11d2582e4e3d9379af0a10b99fc30d953c32f0cbb9a8adb4e57

Contents?: true

Size: 637 Bytes

Versions: 3

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

module Attractor
  # console reporter
  class ConsoleReporter < BaseReporter
    def report
      super
      puts "Calculated churn and complexity"
      puts
      puts "file_path#{" " * 53}complexity   churn"
      puts "-" * 80

      @calculators.each do |calc|
        # e.g. ['js', JsCalculator']
        puts calc.last.type

        values = calc.last.calculate
        suggester = Suggester.new(values)

        puts values&.map(&:to_s)
        puts
        puts "Suggestions for refactorings:"
        suggester.suggest&.each { |sug| puts sug.file_path }
        puts
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
attractor-2.3.0 lib/attractor/reporters/console_reporter.rb
attractor-2.2.0 lib/attractor/reporters/console_reporter.rb
attractor-2.1.0 lib/attractor/reporters/console_reporter.rb