rubygems/rubygems

View on GitHub
lib/rubygems/request_set/gem_dependency_api.rb

Summary

Maintainability
D
2 days
Test Coverage

File gem_dependency_api.rb has 409 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Gem::RequestSet::GemDependencyAPI
  ENGINE_MAP = { # :nodoc:
    jruby: %w[jruby],
    jruby_18: %w[jruby],
    jruby_19: %w[jruby],
Severity: Minor
Found in lib/rubygems/request_set/gem_dependency_api.rb - About 5 hrs to fix

    Method gem_platforms has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

      def gem_platforms(name, options) # :nodoc:
        platform_names = Array(options.delete(:platform))
        platform_names.concat Array(options.delete(:platforms))
        platform_names.concat @current_platforms if @current_platforms
    
    
    Severity: Minor
    Found in lib/rubygems/request_set/gem_dependency_api.rb - About 3 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

    Class GemDependencyAPI has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Gem::RequestSet::GemDependencyAPI
      ENGINE_MAP = { # :nodoc:
        jruby: %w[jruby],
        jruby_18: %w[jruby],
        jruby_19: %w[jruby],
    Severity: Minor
    Found in lib/rubygems/request_set/gem_dependency_api.rb - About 2 hrs to fix

      Method gem has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

        def gem(name, *requirements)
          options = requirements.pop if requirements.last.is_a?(Hash)
          options ||= {}
      
          options[:git] = @current_repository if @current_repository
      Severity: Minor
      Found in lib/rubygems/request_set/gem_dependency_api.rb - About 2 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 gem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def gem(name, *requirements)
          options = requirements.pop if requirements.last.is_a?(Hash)
          options ||= {}
      
          options[:git] = @current_repository if @current_repository
      Severity: Minor
      Found in lib/rubygems/request_set/gem_dependency_api.rb - About 1 hr to fix

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

          def ruby(version, options = {})
            engine         = options[:engine]
            engine_version = options[:engine_version]
        
            raise ArgumentError,
        Severity: Minor
        Found in lib/rubygems/request_set/gem_dependency_api.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 gem_git_reference has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def gem_git_reference(options) # :nodoc:
            ref    = options.delete :ref
            branch = options.delete :branch
            tag    = options.delete :tag
        
        
        Severity: Minor
        Found in lib/rubygems/request_set/gem_dependency_api.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 gem_requires has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def gem_requires(name, options) # :nodoc:
            if options.include? :require
              if requires = options.delete(:require)
                @requires[name].concat Array requires
              end
        Severity: Minor
        Found in lib/rubygems/request_set/gem_dependency_api.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

        Method initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def initialize(set, path)
            @set = set
            @path = path
        
            @current_groups     = nil
        Severity: Minor
        Found in lib/rubygems/request_set/gem_dependency_api.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

        There are no issues that match your filters.

        Category
        Status