rubygems/rubygems

View on GitHub

Showing 934 of 940 total issues

File resolv.rb has 2201 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'socket'
require_relative '../../timeout/lib/timeout'
require 'io/wait'

begin
Severity: Major
Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 6 days to fix

    File specification.rb has 1387 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative "deprecate"
    require_relative "basic_specification"
    require_relative "stub_specification"
    require_relative "platform"
    require_relative "util/list"
    Severity: Major
    Found in lib/rubygems/specification.rb - About 3 days to fix

      Class Specification has 179 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Gem::Specification < Gem::BasicSpecification
        extend Gem::Deprecate
      
        # REFACTOR: Consider breaking out this version stuff into a separate
        # module. There's enough special stuff around it that it may justify
      Severity: Major
      Found in lib/rubygems/specification.rb - About 3 days to fix

        File optparse.rb has 1142 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class Gem::OptionParser
          Gem::OptionParser::Version = "0.4.0"
        
          # :stopdoc:
          NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
        Severity: Major
        Found in lib/rubygems/vendor/optparse/lib/optparse.rb - About 2 days to fix

          Method parse_in_order has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
          Open

            def parse_in_order(argv = default_argv, setter = nil, &nonopt)  # :nodoc:
              opt, arg, val, rest = nil
              nonopt ||= proc {|a| throw :terminate, a}
              argv.unshift(arg) if arg = catch(:terminate) {
                while arg = argv.shift
          Severity: Minor
          Found in lib/rubygems/vendor/optparse/lib/optparse.rb - About 2 days 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 make_switch has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
          Open

            def make_switch(opts, block = nil)
              short, long, nolong, style, pattern, conv, not_pattern, not_conv, not_style = [], [], []
              ldesc, sdesc, desc, arg = [], [], []
              default_style = Switch::NoArgument
              default_pattern = nil
          Severity: Minor
          Found in lib/rubygems/vendor/optparse/lib/optparse.rb - About 2 days 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

          File definition.rb has 775 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require_relative "lockfile_parser"
          
          module Bundler
            class Definition
              include GemHelpers
          Severity: Major
          Found in bundler/lib/bundler/definition.rb - About 1 day to fix

            File generic.rb has 770 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require_relative 'common'
            autoload :IPSocket, 'socket'
            autoload :IPAddr, 'ipaddr'
            
            module Gem::URI
            Severity: Major
            Found in lib/rubygems/vendor/uri/lib/uri/generic.rb - About 1 day to fix

              File licenses.rb has 758 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require_relative "../text"
              
              class Gem::Licenses
                extend Gem::Text
              
              
              Severity: Major
              Found in lib/rubygems/util/licenses.rb - About 1 day to fix

                File http.rb has 745 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require_relative '../../../net-protocol/lib/net/protocol'
                require_relative '../../../uri/lib/uri'
                require_relative '../../../resolv/lib/resolv'
                autoload :OpenSSL, 'openssl'
                
                
                Severity: Major
                Found in lib/rubygems/vendor/net-http/lib/net/http.rb - About 1 day to fix

                  File cli.rb has 705 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require_relative "vendored_thor"
                  
                  module Bundler
                    class CLI < Thor
                      require_relative "cli/common"
                  Severity: Major
                  Found in bundler/lib/bundler/cli.rb - About 1 day to fix

                    Class Definition has 80 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class Definition
                        include GemHelpers
                    
                        class << self
                          # Do not create or modify a lockfile (Makes #lock a noop)
                    Severity: Major
                    Found in bundler/lib/bundler/definition.rb - About 1 day to fix

                      Class HTTP has 77 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class HTTP < Protocol
                      
                          # :stopdoc:
                          VERSION = "0.4.0"
                          HTTPVersion = '1.1'
                      Severity: Major
                      Found in lib/rubygems/vendor/net-http/lib/net/http.rb - About 1 day to fix

                        File rubygems.rb has 645 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require "rbconfig"
                        
                        module Gem
                          VERSION = "3.6.0.dev"
                        end
                        Severity: Major
                        Found in lib/rubygems.rb - About 1 day to fix

                          Class Generic has 72 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class Generic
                              include Gem::URI
                          
                              #
                              # A Default port of nil for Gem::URI::Generic.
                          Severity: Major
                          Found in lib/rubygems/vendor/uri/lib/uri/generic.rb - About 1 day to fix

                            Class OptionParser has 67 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Gem::OptionParser
                              Gem::OptionParser::Version = "0.4.0"
                            
                              # :stopdoc:
                              NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
                            Severity: Major
                            Found in lib/rubygems/vendor/optparse/lib/optparse.rb - About 1 day to fix

                              File installer.rb has 572 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              require_relative "installer_uninstaller_utils"
                              require_relative "exceptions"
                              require_relative "deprecate"
                              require_relative "package"
                              require_relative "ext"
                              Severity: Major
                              Found in lib/rubygems/installer.rb - About 1 day to fix

                                File resolution.rb has 514 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                module Gem::Molinillo
                                  class Resolver
                                    # A specific resolution from a given {Resolver}
                                    class Resolution
                                      # A conflict that the resolution process encountered
                                Severity: Major
                                Found in lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb - About 1 day to fix

                                  File setup_command.rb has 510 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  require_relative "../command"
                                  
                                  ##
                                  # Installs RubyGems itself.  This command is ordinarily only available from a
                                  # RubyGems checkout or tarball.
                                  Severity: Major
                                  Found in lib/rubygems/commands/setup_command.rb - About 1 day to fix

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language