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'
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 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"
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:
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
- 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 842 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "lockfile_parser"
module Bundler
class Definition
include GemHelpers
File licenses.rb
has 811 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "../text"
class Gem::Licenses
extend Gem::Text
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'
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
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)
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"
File rubygems.rb
has 656 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rbconfig"
module Gem
VERSION = "3.7.0.dev"
end
Class HTTP
has 78 methods (exceeds 20 allowed). Consider refactoring. Open
class HTTP < Protocol
# :stopdoc:
VERSION = "0.6.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.
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
- 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
Class OptionParser
has 69 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::OptionParser
# The version string
Gem::OptionParser::Version = "0.6.0"
# :stopdoc:
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"
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
- 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 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"