bundler/bundler

View on GitHub

Showing 280 of 280 total issues

File definition.rb has 728 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_relative "lockfile_parser"
require "set"

module Bundler
  class Definition
Severity: Major
Found in lib/bundler/definition.rb - About 1 day to fix

    File cli.rb has 713 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative "vendored_thor"
    
    module Bundler
      class CLI < Thor
        require_relative "cli/common"
    Severity: Major
    Found in lib/bundler/cli.rb - About 1 day to fix

      Class RubygemsIntegration has 74 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class RubygemsIntegration
          if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
            EXT_LOCK = Gem::Ext::Builder::CHDIR_MONITOR
          else
            require "monitor"
      Severity: Major
      Found in lib/bundler/rubygems_integration.rb - About 1 day to fix

        Class Definition has 67 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Definition
            include GemHelpers
        
            attr_reader(
              :dependencies,
        Severity: Major
        Found in lib/bundler/definition.rb - About 1 day to fix

          Method converge_locked_specs has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
          Open

              def converge_locked_specs
                deps = []
          
                # Build a list of dependencies that are the same in the Gemfile
                # and Gemfile.lock. If the Gemfile modified a dependency, but
          Severity: Minor
          Found in lib/bundler/definition.rb - About 1 day 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 58 (exceeds 5 allowed). Consider refactoring.
          Open

              def run
                Bundler.ui.level = "error" if options[:quiet]
          
                warn_if_root
          
          
          Severity: Minor
          Found in lib/bundler/cli/install.rb - About 1 day 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 50 (exceeds 5 allowed). Consider refactoring.
          Open

              def run
                check_for_deployment_mode!
          
                gems.each do |gem_name|
                  Bundler::CLI::Common.select_spec(gem_name)
          Severity: Minor
          Found in lib/bundler/cli/outdated.rb - About 7 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 bundler.rb has 487 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require_relative "bundler/vendored_fileutils"
          require "pathname"
          require "rbconfig"
          
          require_relative "bundler/errors"
          Severity: Minor
          Found in lib/bundler.rb - About 7 hrs to fix

            File rubygems_integration.rb has 486 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require "rubygems" unless defined?(Gem)
            
            module Bundler
              class RubygemsIntegration
                if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
            Severity: Minor
            Found in lib/bundler/rubygems_integration.rb - About 7 hrs to fix

              Method gem has a Cognitive Complexity of 46 (exceeds 5 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 7 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 dsl.rb has 454 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require_relative "dependency"
              require_relative "ruby_dsl"
              
              module Bundler
                class Dsl
              Severity: Minor
              Found in lib/bundler/dsl.rb - About 6 hrs to fix

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

                    def run
                      Bundler.ui.confirm "Creating gem '#{name}'..."
                
                      underscored_name = name.tr("-", "_")
                      namespaced_path = name.tr("-", "/")
                Severity: Minor
                Found in lib/bundler/cli/gem.rb - About 6 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 41 (exceeds 5 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: Minor
                Found in lib/bundler/cli/update.rb - About 6 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

                Class Rubygems has 45 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class Rubygems < Source
                      autoload :Remote, File.expand_path("rubygems/remote", __dir__)
                
                      # Use the API when installing less than X gems
                      API_REQUEST_LIMIT = 500
                Severity: Minor
                Found in lib/bundler/source/rubygems.rb - About 6 hrs to fix

                  Method install has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def install(spec, opts = {})
                          force = opts[:force]
                          ensure_builtin_gems_cached = opts[:ensure_builtin_gems_cached]
                  
                          if ensure_builtin_gems_cached && builtin_gem?(spec)
                  Severity: Minor
                  Found in lib/bundler/source/rubygems.rb - About 6 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 version_conflict_message has a Cognitive Complexity of 39 (exceeds 5 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: Minor
                  Found in lib/bundler/resolver.rb - About 5 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 rubygems.rb has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "rubygems/user_interaction"
                  
                  module Bundler
                    class Source
                      class Rubygems < Source
                  Severity: Minor
                  Found in lib/bundler/source/rubygems.rb - About 5 hrs to fix

                    Class CLI has 43 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class CLI < Thor
                        require_relative "cli/common"
                    
                        package_name "Bundler"
                    
                    
                    Severity: Minor
                    Found in lib/bundler/cli.rb - About 5 hrs to fix

                      Class Settings has 40 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class Settings
                          autoload :Mirror,  File.expand_path("mirror", __dir__)
                          autoload :Mirrors, File.expand_path("mirror", __dir__)
                          autoload :Validator, File.expand_path("settings/validator", __dir__)
                      
                      
                      Severity: Minor
                      Found in lib/bundler/settings.rb - About 5 hrs to fix

                        Method require has a Cognitive Complexity of 35 (exceeds 5 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 5 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

                        Severity
                        Category
                        Status
                        Source
                        Language