bundler/bundler

View on GitHub
lib/bundler/cli/install.rb

Summary

Maintainability
D
1 day
Test Coverage

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 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

    Method normalize_settings has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def normalize_settings
          Bundler.settings.set_command_option :path, nil if options[:system]
          Bundler.settings.temporary(:path_relative_to_cwd => false) do
            Bundler.settings.set_command_option :path, "vendor/bundle" if Bundler.settings[:deployment] && Bundler.settings[:path].nil?
          end
    Severity: Minor
    Found in lib/bundler/cli/install.rb - About 1 hr 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 check_for_options_conflicts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_for_options_conflicts
          if (options[:path] || options[:deployment]) && options[:system]
            error_message = String.new
            error_message << "You have specified both --path as well as --system. Please choose only one option.\n" if options[:path]
            error_message << "You have specified both --deployment as well as --system. Please choose only one option.\n" if options[:deployment]
    Severity: Minor
    Found in lib/bundler/cli/install.rb - About 35 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 normalize_groups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def normalize_groups
          options[:with] &&= options[:with].join(":").tr(" ", ":").split(":")
          options[:without] &&= options[:without].join(":").tr(" ", ":").split(":")
    
          check_for_group_conflicts_in_cli_options
    Severity: Minor
    Found in lib/bundler/cli/install.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

          # TODO: remove this when we drop Bundler 1.x support
    Severity: Minor
    Found in lib/bundler/cli/install.rb by fixme

    There are no issues that match your filters.

    Category
    Status