Sha256: 47dd12e9ab1b704a33a534f046c740347407a6f6e422523c1140b9c6f1c2b1fa

Contents?: true

Size: 632 Bytes

Versions: 30

Compression:

Stored size: 632 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(2)
          print green '.'
        end
        puts ''
      end

      def to_s
        'complexity'
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
rubycritic-4.9.1 lib/rubycritic/analysers/complexity.rb
rubycritic-4.9.0 lib/rubycritic/analysers/complexity.rb
rubycritic-4.8.1 lib/rubycritic/analysers/complexity.rb
rubycritic-4.8.0 lib/rubycritic/analysers/complexity.rb
rubycritic-4.7.0 lib/rubycritic/analysers/complexity.rb
rubycritic-4.6.1 lib/rubycritic/analysers/complexity.rb
rubycritic-4.6.0 lib/rubycritic/analysers/complexity.rb
rubycritic-4.5.2 lib/rubycritic/analysers/complexity.rb
rubycritic-4.5.1 lib/rubycritic/analysers/complexity.rb
rubycritic-4.5.0 lib/rubycritic/analysers/complexity.rb
rubycritic-4.4.1 lib/rubycritic/analysers/complexity.rb
rubycritic-4.4.0 lib/rubycritic/analysers/complexity.rb
rubycritic-4.3.3 lib/rubycritic/analysers/complexity.rb
rubycritic-4.3.2 lib/rubycritic/analysers/complexity.rb
rubycritic-4.3.1 lib/rubycritic/analysers/complexity.rb
rubycritic-4.3.0 lib/rubycritic/analysers/complexity.rb
rubycritic-4.2.2 lib/rubycritic/analysers/complexity.rb
rubycritic-4.2.1 lib/rubycritic/analysers/complexity.rb
rubycritic-4.2.0 lib/rubycritic/analysers/complexity.rb
rubycritic-simplecov-4.1.1 lib/rubycritic/analysers/complexity.rb