bundler/bundler

View on GitHub

Showing 262 of 280 total issues

Class API has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

    class API
      # This class provides the base to build source plugins
      # All the method here are required to build a source plugin (except
      # `uri_hash`, `gem_install_dir`; they are helpers).
      #
Severity: Minor
Found in lib/bundler/plugin/api/source.rb - About 3 hrs to fix

    Method version_conflict_message has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def version_conflict_message(e)
          # only show essential conflicts, if possible
          conflicts = e.conflicts.dup
          conflicts.delete_if do |_name, conflict|
            deps = conflict.requirement_trees.map(&:last).flatten(1)
    Severity: Major
    Found in lib/bundler/resolver.rb - About 3 hrs to fix

      Class GemHelper has 26 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class GemHelper
          include Rake::DSL if defined? Rake::DSL
      
          class << self
            # set when install'd.
      Severity: Minor
      Found in lib/bundler/gem_helper.rb - About 3 hrs to fix

        Class Path has 26 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Path < Source
              autoload :Installer, File.expand_path("path/installer", __dir__)
        
              attr_reader :path, :options, :root_path, :original_path
              attr_writer :name
        Severity: Minor
        Found in lib/bundler/source/path.rb - About 3 hrs to fix

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

              def run
                Bundler.ui.level = "error" if options[:quiet]
          
                Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
          
          
          Severity: Major
          Found in lib/bundler/cli/update.rb - About 3 hrs to fix

            Method initialize has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
                  if [true, false].include?(unlock)
                    @unlocking_bundler = false
                    @unlocking = unlock
                  else
            Severity: Major
            Found in lib/bundler/definition.rb - About 2 hrs to fix

              Method verify_gemfile_dependencies_are_found! has a Cognitive Complexity of 20 (exceeds 5 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 2 hrs 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 sort_dep_specs has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  def sort_dep_specs(spec_groups, locked_spec)
                    return spec_groups unless locked_spec
                    @gem_name = locked_spec.name
                    @locked_version = locked_spec.version
              
              
              Severity: Minor
              Found in lib/bundler/gem_version_promoter.rb - About 2 hrs 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 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def run
                    Bundler.ui.level = "error" if options[:quiet]
              
                    warn_if_root
              
              
              Severity: Major
              Found in lib/bundler/cli/install.rb - About 2 hrs to fix

                Class Index has 24 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class Index
                    include Enumerable
                
                    def self.build
                      i = new
                Severity: Minor
                Found in lib/bundler/index.rb - About 2 hrs to fix

                  Class Resolver has 24 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class Resolver
                      require_relative "vendored_molinillo"
                      require_relative "resolver/spec_group"
                  
                      # Figures out the best possible configuration of gems that satisfies
                  Severity: Minor
                  Found in lib/bundler/resolver.rb - About 2 hrs to fix

                    Class SpecSet has 24 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class SpecSet
                        include Enumerable
                        include TSort
                    
                        def initialize(specs)
                    Severity: Minor
                    Found in lib/bundler/spec_set.rb - About 2 hrs to fix

                      Method initialize has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
                            if [true, false].include?(unlock)
                              @unlocking_bundler = false
                              @unlocking = unlock
                            else
                      Severity: Minor
                      Found in lib/bundler/definition.rb - About 2 hrs 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 define_task has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def self.define_task(context, task_method = :task, opts = {})
                            if defined?(Capistrano) && context.is_a?(Capistrano::Configuration)
                              context_name = "capistrano"
                              role_default = "{:except => {:no_release => true}}"
                              error_type = ::Capistrano::CommandError
                      Severity: Minor
                      Found in lib/bundler/deployment.rb - About 2 hrs 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 19 (exceeds 5 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 2 hrs 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

                      File shared_helpers.rb has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require "pathname"
                      require "rbconfig"
                      
                      require_relative "version"
                      require_relative "constants"
                      Severity: Minor
                      Found in lib/bundler/shared_helpers.rb - About 2 hrs to fix

                        Method empty? has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def self.empty?(ranges, neqs)
                              !ranges.reduce(ReqR::UNIVERSAL) do |last_range, curr_range|
                                next false unless last_range
                                next false if curr_range.single? && neqs.include?(curr_range.left.version)
                                next curr_range if last_range.right.version == ReqR::INFINITY
                        Severity: Minor
                        Found in lib/bundler/version_ranges.rb - About 2 hrs 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 build_gem_lines has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def build_gem_lines(conservative_versioning)
                              @deps.map do |d|
                                name = d.name.dump
                        
                                requirement = if conservative_versioning
                        Severity: Minor
                        Found in lib/bundler/injector.rb - About 2 hrs 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 a Cognitive Complexity of 18 (exceeds 5 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 2 hrs 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_equivalent_gemfile_and_lockfile has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
                              msg = String.new
                              msg << "You are trying to install in deployment mode after changing\n" \
                                     "your Gemfile. Run `bundle install` elsewhere and add the\n" \
                                     "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
                        Severity: Major
                        Found in lib/bundler/definition.rb - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language