rubygems/rubygems

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

Summary

Maintainability
C
1 day
Test Coverage

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

    def run
      check_for_deployment_mode!

      gems.each do |gem_name|
        Bundler::CLI::Common.select_spec(gem_name)
Severity: Minor
Found in bundler/lib/bundler/cli/outdated.rb - About 7 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 run has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def run
      check_for_deployment_mode!

      gems.each do |gem_name|
        Bundler::CLI::Common.select_spec(gem_name)
Severity: Major
Found in bundler/lib/bundler/cli/outdated.rb - About 3 hrs to fix

    Method update_present_via_semver_portions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def update_present_via_semver_portions(current_spec, active_spec, options)
          current_major = current_spec.version.segments.first
          active_major = active_spec.version.segments.first
    
          update_present = false
    Severity: Minor
    Found in bundler/lib/bundler/cli/outdated.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 print_gem has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def print_gem(current_spec, active_spec, dependency, groups)
          spec_version = "#{active_spec.version}#{active_spec.git_version}"
          if Bundler.ui.debug?
            loaded_from = loaded_from_for(active_spec)
            spec_version += " (from #{loaded_from})" if loaded_from
    Severity: Minor
    Found in bundler/lib/bundler/cli/outdated.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

    There are no issues that match your filters.

    Category
    Status