Showing 262 of 280 total issues
Method run
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
Bundler.ui.silence do
Bundler.definition.validate_runtime!
Bundler.load.lock
end
Method filter_dep_specs
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def filter_dep_specs(spec_groups, locked_spec)
res = spec_groups.select do |spec_group|
if locked_spec && !major?
gsv = spec_group.version
lsv = locked_spec.version
- 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 request
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def request(uri, headers)
validate_uri_scheme!(uri)
Bundler.ui.debug "HTTP GET #{uri}"
req = Net::HTTP::Get.new uri.request_uri, headers
- 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 load
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def load(str)
res = {}
stack = [res]
last_hash = nil
last_empty_key = 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 warn_old_tls_version_rubygems_connection
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def warn_old_tls_version_rubygems_connection(uri, connection)
return unless connection.http.use_ssl?
return unless (uri.host || "").end_with?("rubygems.org")
socket = connection.instance_variable_get(:@socket)
- 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 parse_metadata
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parse_metadata(data)
return unless data
data.each do |k, v|
next unless v
case k.to_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 index_for
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def index_for(dependency)
source = @source_requirements[dependency.name]
if source
source.specs
elsif @lockfile_uses_separate_rubygems_sources
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def run(options)
create_bundle_path
ProcessLock.lock do
if Bundler.frozen_bundle?
- 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 parse_dependency
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parse_dependency(line)
return unless line =~ NAME_VERSION
spaces = $1
return unless spaces.size == 2
name = $2
- 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 __materialize__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __materialize__
search_object = Bundler.feature_flag.specific_platform? || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
@specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
source.gemspec.tap {|s| s.source = source }
else
- 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 select_spec
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.select_spec(name, regex_match = nil)
specs = []
regexp = Regexp.new(name) if regex_match
Bundler.definition.specs.each do |spec|
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def run
# The required arguments allow Thor to give useful feedback when the arguments
# are incorrect. This adds those first two arguments onto the list as a whole.
gems.unshift(source).unshift(group).unshift(version).unshift(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 initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(lockfile)
@platforms = []
@sources = []
@dependencies = {}
@state = nil
Method run
has 34 lines of code (exceeds 25 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)
Method load_spec_files
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_spec_files
index = Index.new
if File.directory?(expanded_path)
# We sort depth-first since `<<` will override the earlier-found specs
Consider simplifying this complex logical expression. Open
if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
end
Method replace_gem
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def replace_gem(specs, specs_by_name)
reverse_rubygems_kernel_mixin
executables = nil
Method run
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
@groups.each do |group|
g.add_nodes(
group, {
:style => "filled",
Method verify_gemfile_dependencies_are_found!
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def verify_gemfile_dependencies_are_found!(requirements)
requirements.each do |requirement|
name = requirement.name
next if name == "bundler"
next unless search_for(requirement).empty?
Method log_error
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def log_error(error)
case error
when YamlSyntaxError
Bundler.ui.error error.message
Bundler.ui.trace error.orig_exception