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
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"
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
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
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
- Read upRead up
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
- Read upRead up
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
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
File licenses.rb
has 758 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "../text"
class Gem::Licenses
extend Gem::Text
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'
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"
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)
Class HTTP
has 77 methods (exceeds 20 allowed). Consider refactoring. Open
class HTTP < Protocol
# :stopdoc:
VERSION = "0.4.0"
HTTPVersion = '1.1'
File rubygems.rb
has 645 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rbconfig"
module Gem
VERSION = "3.6.0.dev"
end
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.
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
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"
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
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.
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
- Read upRead up
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"