Showing 262 of 280 total issues
Method run
has 126 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("-", "/")
Class Git
has 38 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 ensure_equivalent_gemfile_and_lockfile
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
msg = String.new
msg << "You are trying to install in deployment mode after changing\n" \
"your Gemfile. Run `bundle install` elsewhere and add the\n" \
"updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
- 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 for
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
handled = Set.new
deps = dependencies.dup
specs = []
skip += ["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
File settings.rb
has 364 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__)
File resolver.rb
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Bundler
class Resolver
require_relative "vendored_molinillo"
require_relative "resolver/spec_group"
Method update
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def update(local_path, remote_path, retrying = nil)
headers = {}
Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir|
local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename)
- 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 specs
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def specs(gem_names, source)
old = Bundler.rubygems.sources
index = Bundler::Index.new
if Bundler::Fetcher.disable_endpoint
- 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 replace_gem
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def replace_gem(specs, specs_by_name)
reverse_rubygems_kernel_mixin
executables = 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
Method replace_bin_path
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def replace_bin_path(specs_by_name)
gem_class = (class << Gem; self; end)
redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
exec_name = args.first
- 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 normalize_options
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def normalize_options(name, version, opts)
if name.is_a?(Symbol)
raise GemfileError, %(You need to specify gem names as Strings. Use 'gem "#{name}"' instead)
end
if name =~ /\s/
- 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 generate_bundler_executable_stubs
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def generate_bundler_executable_stubs(spec, options = {})
if options[:binstubs_cmd] && spec.executables.empty?
options = {}
spec.runtime_dependencies.each do |dep|
bins = @definition.specs[dep].first.executables
- 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 a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def run
CLI::Common.ensure_all_gems_in_lockfile!(@gems)
definition = Bundler.definition
definition.validate_runtime!
installer = Bundler::Installer.new(Bundler.root, definition)
- 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 a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def run
Bundler.ui.silence do
Bundler.definition.validate_runtime!
Bundler.load.lock
end
- 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 install
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install(spec, opts = {})
force = opts[:force]
ensure_builtin_gems_cached = opts[:ensure_builtin_gems_cached]
if ensure_builtin_gems_cached && builtin_gem?(spec)
Class Dsl
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Dsl
include RubyDsl
def self.evaluate(gemfile, lockfile, unlock)
builder = new
Method show
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def show(gem_name = nil)
if ARGV[0] == "show"
rest = ARGV[1..-1]
if flag = rest.find{|arg| ["--verbose", "--outdated"].include?(arg) }
- 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 SourceList
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class SourceList
attr_reader :path_sources,
:git_sources,
:plugin_sources,
:global_rubygems_source,
Method run
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
check_for_deployment_mode!
gems.each do |gem_name|
Bundler::CLI::Common.select_spec(gem_name)
Method warn_on_outdated_bundler
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def warn_on_outdated_bundler
return if Bundler.settings[:disable_version_check]
command_name = current_command.name
return if PARSEABLE_COMMANDS.include?(command_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"