bundler/bundler

View on GitHub

Showing 262 of 280 total issues

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

    def check_home_permissions
      require "find"
      files_not_readable_or_writable = []
      files_not_rw_and_owned_by_different_user = []
      files_not_owned_by_current_user_but_still_rw = []
Severity: Minor
Found in lib/bundler/cli/doctor.rb - About 1 hr to fix

    Method source has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def source(source, *args, &blk)
          options = args.last.is_a?(Hash) ? args.pop.dup : {}
          options = normalize_hash(options)
          source = normalize_source(source)
    
    
    Severity: Minor
    Found in lib/bundler/dsl.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 fetch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def fetch(uri, headers = {}, counter = 0)
            raise HTTPError, "Too many redirects" if counter >= redirect_limit
    
            response = request(uri, headers)
            Bundler.ui.debug("HTTP #{response.code} #{response.message} #{uri}")
    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 report has a Cognitive Complexity of 11 (exceeds 5 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

    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_bundler_checksum has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def validate_bundler_checksum(checksum)
          return true if Bundler.settings[:disable_checksum_validation]
          return true unless checksum
          return true unless source = @package.instance_variable_get(:@gem)
          return true unless source.respond_to?(:with_read_io)
    Severity: Minor
    Found in lib/bundler/rubygems_gem_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 local_override! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def local_override!(path)
            return false if local?
    
            original_path = path
            path = Pathname.new(path)
    Severity: Minor
    Found in lib/bundler/source/git.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 expand_dependencies has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def expand_dependencies(dependencies, remote = false)
          sorted_platforms = Resolver.sort_platforms(@platforms)
          deps = []
          dependencies.each do |dep|
            dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
    Severity: Minor
    Found in lib/bundler/definition.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 double_check_for has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def double_check_for(unmet_dependency_names)
            return unless @allow_remote
            return unless api_fetchers.any?
    
            unmet_dependency_names = unmet_dependency_names.call
    Severity: Minor
    Found in lib/bundler/source/rubygems.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 diff has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def diff(other)
          raise ArgumentError, "Can only diff with a RubyVersion, not a #{other.class}" unless other.is_a?(RubyVersion)
          if engine != other.engine && @input_engine
            [:engine, engine, other.engine]
          elsif versions.empty? || !matches?(versions, other.gem_version)
    Severity: Minor
    Found in lib/bundler/ruby_version.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 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def run
          raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @only_group.any? && @without_group.any?
    
          raise InvalidOption, "The `--name-only` and `--paths` options cannot be used together" if @options["name-only"] && @options[:paths]
    
    
    Severity: Minor
    Found in lib/bundler/cli/list.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_install has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def gemfile_install(gemfile = nil, &inline)
          Bundler.settings.temporary(:frozen => false, :deployment => false) do
            builder = DSL.new
            if block_given?
              builder.instance_eval(&inline)
    Severity: Minor
    Found in lib/bundler/plugin.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_to_gemfile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def dependencies_to_gemfile(dependencies, group = nil)
          gemfile = String.new
          if dependencies.any?
            gemfile << "group :#{group} do\n" if group
            dependencies.each do |dependency|
    Severity: Minor
    Found in lib/bundler/rubygems_ext.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 check_home_permissions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_home_permissions
          require "find"
          files_not_readable_or_writable = []
          files_not_rw_and_owned_by_different_user = []
          files_not_owned_by_current_user_but_still_rw = []
    Severity: Minor
    Found in lib/bundler/cli/doctor.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 require has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def require(*groups)
          groups.map!(&:to_sym)
          groups = [:default] if groups.empty?
    
          @definition.dependencies.each do |dep|
    Severity: Minor
    Found in lib/bundler/runtime.rb - About 1 hr to fix

      Method specs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def specs(gem_names, source)
            old = Bundler.rubygems.sources
            index = Bundler::Index.new
      
            if Bundler::Fetcher.disable_endpoint
      Severity: Minor
      Found in lib/bundler/fetcher.rb - About 1 hr to fix

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

            def run
              Bundler.definition.validate_runtime!
              path_option = options["path"]
              path_option = nil if path_option && path_option.empty?
              Bundler.settings.set_command_option :bin, path_option if options["path"]
        Severity: Minor
        Found in lib/bundler/cli/binstubs.rb - About 1 hr to fix

          Method fetch has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def fetch(uri, headers = {}, counter = 0)
                  raise HTTPError, "Too many redirects" if counter >= redirect_limit
          
                  response = request(uri, headers)
                  Bundler.ui.debug("HTTP #{response.code} #{response.message} #{uri}")
          Severity: Minor
          Found in lib/bundler/fetcher/downloader.rb - About 1 hr to fix

            Method copy_to has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def copy_to(destination, submodules = false)
                      # method 1
                      unless File.exist?(destination.join(".git"))
                        begin
                          SharedHelpers.filesystem_access(destination.dirname) do |p|
            Severity: Minor
            Found in lib/bundler/source/git/git_proxy.rb - About 1 hr to fix

              Method run has 29 lines of code (exceeds 25 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

                Method validate_bundler_checksum has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def validate_bundler_checksum(checksum)
                      return true if Bundler.settings[:disable_checksum_validation]
                      return true unless checksum
                      return true unless source = @package.instance_variable_get(:@gem)
                      return true unless source.respond_to?(:with_read_io)
                Severity: Minor
                Found in lib/bundler/rubygems_gem_installer.rb - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language