bundler/bundler

View on GitHub

Showing 262 of 280 total issues

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

    def run
      Bundler.ui.silence do
        Bundler.definition.validate_runtime!
        Bundler.load.lock
      end
Severity: Minor
Found in lib/bundler/cli/show.rb - About 1 hr to fix

    Method filter_dep_specs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def filter_dep_specs(spec_groups, locked_spec)
          res = spec_groups.select do |spec_group|
            if locked_spec && !major?
              gsv = spec_group.version
              lsv = locked_spec.version
    Severity: Minor
    Found in lib/bundler/gem_version_promoter.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 request has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

          def request(uri, headers)
            validate_uri_scheme!(uri)
    
            Bundler.ui.debug "HTTP GET #{uri}"
            req = Net::HTTP::Get.new uri.request_uri, headers
    Severity: Minor
    Found in lib/bundler/fetcher/downloader.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 load has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(str)
          res = {}
          stack = [res]
          last_hash = nil
          last_empty_key = nil
    Severity: Minor
    Found in lib/bundler/yaml_serializer.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_old_tls_version_rubygems_connection has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def warn_old_tls_version_rubygems_connection(uri, connection)
          return unless connection.http.use_ssl?
          return unless (uri.host || "").end_with?("rubygems.org")
    
          socket = connection.instance_variable_get(:@socket)
    Severity: Minor
    Found in lib/bundler/vendored_persistent.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_metadata has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_metadata(data)
          return unless data
          data.each do |k, v|
            next unless v
            case k.to_s
    Severity: Minor
    Found in lib/bundler/endpoint_specification.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 index_for has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def index_for(dependency)
          source = @source_requirements[dependency.name]
          if source
            source.specs
          elsif @lockfile_uses_separate_rubygems_sources
    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 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(options)
          create_bundle_path
    
          ProcessLock.lock do
            if Bundler.frozen_bundle?
    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 parse_dependency has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_dependency(line)
          return unless line =~ NAME_VERSION
          spaces = $1
          return unless spaces.size == 2
          name = $2
    Severity: Minor
    Found in lib/bundler/lockfile_parser.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 __materialize__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def __materialize__
          search_object = Bundler.feature_flag.specific_platform? || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
          @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
            source.gemspec.tap {|s| s.source = source }
          else
    Severity: Minor
    Found in lib/bundler/lazy_specification.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 select_spec has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.select_spec(name, regex_match = nil)
          specs = []
          regexp = Regexp.new(name) if regex_match
    
          Bundler.definition.specs.each do |spec|
    Severity: Minor
    Found in lib/bundler/cli/common.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 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def run
          # The required arguments allow Thor to give useful feedback when the arguments
          # are incorrect. This adds those first two arguments onto the list as a whole.
          gems.unshift(source).unshift(group).unshift(version).unshift(name)
    
    
    Severity: Minor
    Found in lib/bundler/cli/inject.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 initialize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def initialize(lockfile)
          @platforms    = []
          @sources      = []
          @dependencies = {}
          @state        = nil
    Severity: Minor
    Found in lib/bundler/lockfile_parser.rb - About 1 hr to fix

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

          def run
            CLI::Common.ensure_all_gems_in_lockfile!(@gems)
            definition = Bundler.definition
            definition.validate_runtime!
            installer = Bundler::Installer.new(Bundler.root, definition)
      Severity: Minor
      Found in lib/bundler/cli/pristine.rb - About 1 hr to fix

        Method load_spec_files has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def load_spec_files
                index = Index.new
        
                if File.directory?(expanded_path)
                  # We sort depth-first since `<<` will override the earlier-found specs
        Severity: Minor
        Found in lib/bundler/source/path.rb - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
                  new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
                  deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
                end
          Severity: Critical
          Found in lib/bundler/definition.rb - About 1 hr to fix

            Method replace_gem has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def replace_gem(specs, specs_by_name)
                  reverse_rubygems_kernel_mixin
            
                  executables = nil
            
            
            Severity: Minor
            Found in lib/bundler/rubygems_integration.rb - About 1 hr to fix

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

                    def run
                      @groups.each do |group|
                        g.add_nodes(
                          group, {
                            :style     => "filled",
              Severity: Minor
              Found in lib/bundler/graph.rb - About 1 hr to fix

                Method verify_gemfile_dependencies_are_found! has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def verify_gemfile_dependencies_are_found!(requirements)
                      requirements.each do |requirement|
                        name = requirement.name
                        next if name == "bundler"
                        next unless search_for(requirement).empty?
                Severity: Minor
                Found in lib/bundler/resolver.rb - About 1 hr to fix

                  Method log_error has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def log_error(error)
                        case error
                        when YamlSyntaxError
                          Bundler.ui.error error.message
                          Bundler.ui.trace error.orig_exception
                  Severity: Minor
                  Found in lib/bundler/friendly_errors.rb - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language