bundler/bundler

View on GitHub
lib/bundler/rubygems_integration.rb

Summary

Maintainability
F
3 days
Test Coverage

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

    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 replace_gem has a Cognitive Complexity of 29 (exceeds 5 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 4 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 replace_bin_path has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def replace_bin_path(specs_by_name)
            gem_class = (class << Gem; self; end)
      
            redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
              exec_name = args.first
      Severity: Minor
      Found in lib/bundler/rubygems_integration.rb - About 3 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 replace_bin_path has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def replace_bin_path(specs_by_name)
            gem_class = (class << Gem; self; end)
      
            redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
              exec_name = args.first
      Severity: Minor
      Found in lib/bundler/rubygems_integration.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 fetch_specs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def fetch_specs(remote, name)
                path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
                fetcher = gem_remote_fetcher
                fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
                string = fetcher.fetch_path(path)
          Severity: Minor
          Found in lib/bundler/rubygems_integration.rb - About 25 mins 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

          There are no issues that match your filters.

          Category
          Status