bundler/bundler

View on GitHub

Showing 262 of 280 total issues

Method run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def run
      unless Bundler.default_gemfile
        Bundler.ui.error "Unable to find a Gemfile to lock"
        exit 1
      end
Severity: Minor
Found in lib/bundler/cli/lock.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method _make_label has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def _make_label(symbol_or_string_or_dependency, element_type)
      case element_type.to_sym
      when :node
        if symbol_or_string_or_dependency.is_a?(Gem::Dependency)
          label = symbol_or_string_or_dependency.name.dup
Severity: Minor
Found in lib/bundler/graph.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

      def run
        unless name
          warn_unused_scope "Ignoring --#{scope}"
          confirm_all
          return
Severity: Minor
Found in lib/bundler/cli/config.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method parse_source has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def parse_source(line)
      case line
      when SPECS
        case @type
        when PATH
Severity: Minor
Found in lib/bundler/lockfile_parser.rb - About 1 hr to fix

    Method gemfile has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def gemfile(install = false, options = {}, &gemfile)
      require_relative "../bundler"
    
      opts = options.dup
      ui = opts.delete(:ui) { Bundler::UI::Shell.new }
    Severity: Minor
    Found in lib/bundler/inline.rb - About 1 hr to fix

      Method validate_resolved_specs! has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def validate_resolved_specs!(resolved_specs)
            resolved_specs.each do |v|
              name = v.name
              next unless sources = relevant_sources_for_vertex(v)
              sources.compact!
      Severity: Minor
      Found in lib/bundler/resolver.rb - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method run has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def run
            platforms, ruby_version = Bundler.ui.silence do
              locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version
              gemfile_ruby_version = Bundler.definition.ruby_version && Bundler.definition.ruby_version.single_version_string
              [Bundler.definition.platforms.map {|p| "* #{p}" },
      Severity: Minor
      Found in lib/bundler/cli/platform.rb - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method report has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def self.report(options = {})
            print_gemfile = options.delete(:print_gemfile) { true }
            print_gemspecs = options.delete(:print_gemspecs) { true }
      
            out = String.new
      Severity: Minor
      Found in lib/bundler/env.rb - About 1 hr to fix

        Method search_for has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def search_for(dependency)
              platform = dependency.__platform
              dependency = dependency.dep unless dependency.is_a? Gem::Dependency
              search = @search_for[dependency] ||= begin
                index = index_for(dependency)
        Severity: Minor
        Found in lib/bundler/resolver.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method __dependencies has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

              def __dependencies
                @dependencies = Hash.new do |dependencies, platform|
                  dependencies[platform] = []
                  if spec = @specs[platform]
                    spec.dependencies.each do |dep|
        Severity: Minor
        Found in lib/bundler/resolver/spec_group.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method warn_on_incompatible_bundler_deps has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def warn_on_incompatible_bundler_deps
              bundler_version = Gem::Version.create(Bundler::VERSION)
              @definition.specs.each do |spec|
                spec.dependencies.each do |dep|
                  next if dep.type == :development
        Severity: Minor
        Found in lib/bundler/installer.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method ensure_specs_are_compatible! has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def ensure_specs_are_compatible!
              system_ruby = Bundler::RubyVersion.system
              rubygems_version = Gem::Version.create(Gem::VERSION)
              @definition.specs.each do |spec|
                if required_ruby_version = spec.required_ruby_version
        Severity: Minor
        Found in lib/bundler/installer.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method credential_filtered_uri has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def credential_filtered_uri(uri_to_anonymize)
              return uri_to_anonymize if uri_to_anonymize.nil?
              uri = uri_to_anonymize.dup
              if uri.is_a?(String)
                require_relative "vendored_uri"
        Severity: Minor
        Found in lib/bundler/uri_credentials_filter.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method remove_nested_blocks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def remove_nested_blocks(gemfile, block_name)
              nested_blocks = 0
        
              # count number of nested blocks
              gemfile.each_with_index {|line, index| nested_blocks += 1 if !gemfile[index + 1].nil? && gemfile[index + 1].include?(block_name) && line.include?(block_name) }
        Severity: Minor
        Found in lib/bundler/injector.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method validate! has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

              def validate!
                return unless explicit_path && system_path
                path = Bundler.settings.pretty_values_for(:path)
                path.unshift(nil, "path:") unless path.empty?
                system_path = Bundler.settings.pretty_values_for("path.system")
        Severity: Minor
        Found in lib/bundler/settings.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method search_up has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def search_up(*names)
              previous = nil
              current  = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
        
              until !File.directory?(current) || current == previous
        Severity: Minor
        Found in lib/bundler/shared_helpers.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method gemfile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        def gemfile(install = false, options = {}, &gemfile)
          require_relative "../bundler"
        
          opts = options.dup
          ui = opts.delete(:ui) { Bundler::UI::Shell.new }
        Severity: Minor
        Found in lib/bundler/inline.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method gem has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def gem(name, *args)
              options = args.last.is_a?(Hash) ? args.pop.dup : {}
              options["gemfile"] = @gemfile
              version = args || [">= 0"]
        
        
        Severity: Minor
        Found in lib/bundler/dsl.rb - About 1 hr to fix

          Method run has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def run
                unless Bundler.default_gemfile
                  Bundler.ui.error "Unable to find a Gemfile to lock"
                  exit 1
                end
          Severity: Minor
          Found in lib/bundler/cli/lock.rb - About 1 hr to fix

            Method environment has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def self.environment
                  out = []
            
                  out << ["Bundler", Bundler::VERSION]
                  out << ["  Platforms", Gem.platforms.join(", ")]
            Severity: Minor
            Found in lib/bundler/env.rb - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language