bundler/bundler

View on GitHub
lib/bundler/source/path.rb

Summary

Maintainability
C
1 day
Test Coverage

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 load_spec_files has a Cognitive Complexity of 17 (exceeds 5 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 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 generate_bin has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

          def generate_bin(spec, options = {})
            gem_dir = Pathname.new(spec.full_gem_path)
    
            # Some gem authors put absolute paths in their gemspec
            # and we have to save them from themselves
    Severity: Minor
    Found in lib/bundler/source/path.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 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

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

            def generate_bin(spec, options = {})
              gem_dir = Pathname.new(spec.full_gem_path)
      
              # Some gem authors put absolute paths in their gemspec
              # and we have to save them from themselves
      Severity: Minor
      Found in lib/bundler/source/path.rb - About 1 hr to fix

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

              def initialize(options)
                @options = options.dup
                @glob = options["glob"] || DEFAULT_GLOB
        
                @allow_cached = false
        Severity: Minor
        Found in lib/bundler/source/path.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

        TODO found
        Open

                if Bundler.current_ruby.jruby? # TODO: Unify when https://github.com/rubygems/bundler/issues/7598 fixed upstream and all supported jrubies include the fix
        Severity: Minor
        Found in lib/bundler/source/path.rb by fixme

        There are no issues that match your filters.

        Category
        Status