Showing 831 of 947 total issues
Method find_proxy
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def find_proxy(env=ENV)
raise BadURIError, "relative Gem::URI: #{self}" if self.relative?
name = self.scheme.downcase + '_proxy'
proxy_uri = nil
if name == 'http_proxy' && env.include?('REQUEST_METHOD') # CGI?
- 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 32 (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 alien
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def alien(gems=[])
errors = Hash.new {|h,k| h[k] = {} }
Gem::Specification.each do |spec|
unless gems.empty?
- 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 resolver.rb
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Bundler
#
# This class implements the interface needed by PubGrub for resolution. It is
# equivalent to the `PubGrub::BasicPackageSource` class provided by PubGrub by
# default and used by the most simple PubGrub consumers.
Method require
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def require(*groups)
groups.map!(&:to_sym)
groups = [:default] if groups.empty?
dependencies = @definition.dependencies.select do |dep|
- 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 command.rb
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "vendored_optparse"
require_relative "requirement"
require_relative "user_interaction"
##
Class SpecSet
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class SpecSet
include Enumerable
include TSort
attr_reader :incomplete_specs
Class SpecificationPolicy
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::SpecificationPolicy
include Gem::UserInteraction
VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/ # :nodoc:
File git_proxy.rb
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Bundler
class Source
class Git
class GitNotInstalledError < GitError
def initialize
File config_file.rb
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "user_interaction"
require "rbconfig"
##
# Gem::ConfigFile RubyGems options and gem command options from gemrc.
Method replace_gem
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def replace_gem(specs, specs_by_name)
executables = nil
[::Kernel.singleton_class, ::Kernel].each do |kernel_class|
redefine_method(kernel_class, :gem) do |dep, *reqs|
- 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 find_gems_with_sources
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def find_gems_with_sources(dep, best_only=false) # :nodoc:
set = Gem::AvailableSet.new
if consider_local?
sl = Gem::Source::Local.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 to_ruby.rb
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "visitor"
module Gem::SafeMarshal
module Visitors
class ToRuby < Visitor
Method generate_bundler_executable_stubs
has a Cognitive Complexity of 28 (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 check_executable_overwrite
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def check_executable_overwrite(filename) # :nodoc:
return if @force
generated_bin = File.join @bin_dir, formatted_program_filename(filename)
- 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 Resolver
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class Resolver
require_relative "vendored_pub_grub"
require_relative "resolver/base"
require_relative "resolver/candidate"
require_relative "resolver/incompatibility"
Class BasicSpecification
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::BasicSpecification
##
# Allows installation of extensions for git: gems.
attr_writer :base_dir # :nodoc:
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 27 (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 /\s/.match?(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 gem_platforms
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def gem_platforms(name, options) # :nodoc:
platform_names = Array(options.delete(:platform))
platform_names.concat Array(options.delete(:platforms))
platform_names.concat @current_platforms if @current_platforms
- 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"