rubinius/rubinius

View on GitHub
library/rubygems/commands/install_command.rb

Summary

Maintainability
A
3 hrs
Test Coverage

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

  def install_gem_without_dependencies name, req # :nodoc:
    gem = nil

    if local? then
      if name =~ /\.gem$/ and File.file? name then
Severity: Minor
Found in library/rubygems/commands/install_command.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 install_gem_without_dependencies has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def install_gem_without_dependencies name, req # :nodoc:
    gem = nil

    if local? then
      if name =~ /\.gem$/ and File.file? name then
Severity: Minor
Found in library/rubygems/commands/install_command.rb - About 1 hr to fix

    Method install_gems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def install_gems # :nodoc:
        exit_code = 0
    
        get_all_gem_names_and_versions.each do |gem_name, gem_version|
          gem_version ||= options[:version]
    Severity: Minor
    Found in library/rubygems/commands/install_command.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 install_gem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def install_gem name, version # :nodoc:
        return if options[:conservative] and
          not Gem::Dependency.new(name, version).matching_specs.empty?
    
        req = Gem::Requirement.create(version)
    Severity: Minor
    Found in library/rubygems/commands/install_command.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

    There are no issues that match your filters.

    Category
    Status