rubygems/rubygems

View on GitHub

Showing 852 of 968 total issues

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

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

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

    Class Specification has 178 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 specification.rb has 1326 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 "specification_record"
      Severity: Major
      Found in lib/rubygems/specification.rb - About 3 days to fix

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

        class Gem::OptionParser
          # The version string
          Gem::OptionParser::Version = "0.6.0"
        
          # :stopdoc:
        Severity: Major
        Found in lib/rubygems/vendor/optparse/lib/optparse.rb - About 3 days to fix

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

            def parse_in_order(argv = default_argv, setter = nil, exact: require_exact, **, &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 842 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 2 days to fix

            File licenses.rb has 811 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 768 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 generic.rb has 768 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

                  Class Definition has 88 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

                    File cli.rb has 671 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

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

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

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

                          class HTTP < Protocol
                        
                            # :stopdoc:
                            VERSION = "0.6.0"
                            HTTPVersion = '1.1'
                        Severity: Major
                        Found in lib/rubygems/vendor/net-http/lib/net/http.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

                            Method run has a Cognitive Complexity of 66 (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

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

                            class Gem::OptionParser
                              # The version string
                              Gem::OptionParser::Version = "0.6.0"
                            
                              # :stopdoc:
                            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

                                Method connect has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def connect
                                      if use_ssl?
                                        # reference early to load OpenSSL before connecting,
                                        # as OpenSSL may take time to load.
                                        @ssl_context = OpenSSL::SSL::SSLContext.new
                                Severity: Minor
                                Found in lib/rubygems/vendor/net-http/lib/net/http.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

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

                                require_relative "bundler/vendored_fileutils"
                                require "pathname"
                                require "rbconfig"
                                
                                require_relative "bundler/errors"
                                Severity: Major
                                Found in bundler/lib/bundler.rb - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language