bundler/bundler

View on GitHub
lib/bundler/source/git/git_proxy.rb

Summary

Maintainability
B
5 hrs
Test Coverage

Class GitProxy has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

      class GitProxy
        attr_accessor :path, :uri, :ref
        attr_writer :revision

        def initialize(path, uri, ref, revision = nil, git = nil)
Severity: Minor
Found in lib/bundler/source/git/git_proxy.rb - About 2 hrs 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 copy_to has a Cognitive Complexity of 9 (exceeds 5 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 55 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

      Method checkout has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def checkout
                return if path.exist? && has_revision_cached?
                extra_ref = "#{Shellwords.shellescape(ref)}:#{Shellwords.shellescape(ref)}" if ref && ref.start_with?("refs/")
      
                Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
      Severity: Minor
      Found in lib/bundler/source/git/git_proxy.rb - About 45 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

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def initialize(path, uri, ref, revision = nil, git = nil)
      Severity: Minor
      Found in lib/bundler/source/git/git_proxy.rb - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status