Showing 830 of 946 total issues
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"
Further reading
File bundler.rb
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "bundler/vendored_fileutils"
require "pathname"
require "rbconfig"
require_relative "bundler/errors"
Method lazy_initialize
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def lazy_initialize
@mutex.synchronize {
unless @initialized
@nameserver_port = []
@use_ipv6 = 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 settings.rb
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Bundler
class Settings
autoload :Mirror, File.expand_path("mirror", __dir__)
autoload :Mirrors, File.expand_path("mirror", __dir__)
autoload :Validator, File.expand_path("settings/validator", __dir__)
Method run
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def run
check_for_deployment_mode!
gems.each do |gem_name|
Bundler::CLI::Common.select_spec(gem_name)
- 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 connect
has a Cognitive Complexity of 50 (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 dsl.rb
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "dependency"
require_relative "ruby_dsl"
module Bundler
class Dsl
Class Installer
has 53 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::Installer
extend Gem::Deprecate
##
# Paths where env(1) might live. Some systems are broken and have it in
Class Settings
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
class Settings
autoload :Mirror, File.expand_path("mirror", __dir__)
autoload :Mirrors, File.expand_path("mirror", __dir__)
autoload :Validator, File.expand_path("settings/validator", __dir__)
Class Rubygems
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
class Rubygems < Source
autoload :Remote, File.expand_path("rubygems/remote", __dir__)
# Ask for X gems per API request
API_REQUEST_SIZE = 50
Method run
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def run
Bundler.ui.level = "warn" if options[:quiet]
update_bundler = options[:bundler]
- 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 run
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
Bundler.ui.confirm "Creating gem '#{name}'..."
underscored_name = name.tr("-", "_")
namespaced_path = name.tr("-", "/")
Method require
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def require(path) # :doc:
return gem_original_require(path) unless Gem.discover_gems_on_require
RUBYGEMS_ACTIVATION_MONITOR.synchronize do
path = File.path(path)
- 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 CLI
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class CLI < Thor
require_relative "cli/common"
require_relative "cli/install"
package_name "Bundler"
Method extract_tar_gz
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
destination_dir = File.realpath(destination_dir)
directories = []
symlinks = []
- 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 GitProxy
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class GitProxy
attr_accessor :path, :uri, :branch, :tag, :ref, :explicit_ref
attr_writer :revision
def initialize(path, uri, options = {}, revision = nil, git = nil)
File common.rb
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "rfc2396_parser"
require_relative "rfc3986_parser"
module Gem::URI
include RFC2396_REGEXP
File package.rb
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "security"
require_relative "user_interaction"
##
# Example using a Gem::Package
Class Git
has 46 methods (exceeds 20 allowed). Consider refactoring. Open
class Git < Path
autoload :GitProxy, File.expand_path("git/git_proxy", __dir__)
attr_reader :uri, :ref, :branch, :options, :glob, :submodules
Method encode_multipart_form_data
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def encode_multipart_form_data(out, params, opt)
charset = opt[:charset]
boundary = opt[:boundary]
require 'securerandom' unless defined?(SecureRandom)
boundary ||= SecureRandom.urlsafe_base64(40)
- 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"