Sha256: 60d80ba67f2cf81182601dabc685be4148536f60f905f7b0bacff1cb0965a950

Contents?: true

Size: 628 Bytes

Versions: 7

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true
require 'rubycritic/analysers/helpers/flog'
require 'rubycritic/colorize'

module RubyCritic
  module Analyser
    class Complexity
      include Colorize
      def initialize(analysed_modules)
        @flog = Flog.new
        @analysed_modules = analysed_modules
      end

      def run
        @analysed_modules.each do |analysed_module|
          @flog.reset
          @flog.flog(analysed_module.path)
          analysed_module.complexity = @flog.total_score.round
          print green '.'
        end
        puts ''
      end

      def to_s
        'complexity'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubycritic-3.2.0 lib/rubycritic/analysers/complexity.rb
rubycritic-3.1.3 lib/rubycritic/analysers/complexity.rb
rubycritic-3.1.2 lib/rubycritic/analysers/complexity.rb
rubycritic-3.1.1 lib/rubycritic/analysers/complexity.rb
rubycritic-3.1.0 lib/rubycritic/analysers/complexity.rb
rubycritic-3.0.0 lib/rubycritic/analysers/complexity.rb
rubycritic-2.9.4 lib/rubycritic/analysers/complexity.rb