rubygems/rubygems

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

Summary

Maintainability
C
1 day
Test Coverage

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

    def run
      Bundler.ui.level = "warn" if options[:quiet]

      warn_if_root

Severity: Minor
Found in bundler/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 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def run
      Bundler.ui.level = "warn" if options[:quiet]

      warn_if_root

Severity: Major
Found in bundler/lib/bundler/cli/install.rb - About 2 hrs to fix

    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 bundler/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_settings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def normalize_settings
          Bundler.settings.set_command_option :path, nil if options[:system]
          Bundler.settings.set_command_option_if_given :path, options[:path]
    
          if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
    Severity: Minor
    Found in bundler/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

    TODO found
    Open

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

    There are no issues that match your filters.

    Category
    Status