Showing 946 of 950 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
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
File specification.rb
has 1333 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"
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 806 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "lockfile_parser"
module Bundler
class Definition
include GemHelpers
File licenses.rb
has 783 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "../text"
class Gem::Licenses
extend Gem::Text
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 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 697 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 82 methods (exceeds 20 allowed). Consider refactoring. Open
class Definition
include GemHelpers
class << self
# Do not create or modify a lockfile (Makes #lock a noop)
File rubygems.rb
has 659 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rbconfig"
module Gem
VERSION = "3.6.0.dev"
end
Class HTTP
has 77 methods (exceeds 20 allowed). Consider refactoring. Open
class HTTP < Protocol
# :stopdoc:
VERSION = "0.4.0"
HTTPVersion = '1.1'
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 573 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"
Class RubygemsIntegration
has 62 methods (exceeds 20 allowed). Consider refactoring. Open
class RubygemsIntegration
require "monitor"
EXT_LOCK = Monitor.new
Method run
has a Cognitive Complexity of 54 (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"
Further reading
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