Showing 262 of 280 total issues
File definition.rb
has 728 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "lockfile_parser"
require "set"
module Bundler
class Definition
File cli.rb
has 713 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "vendored_thor"
module Bundler
class CLI < Thor
require_relative "cli/common"
Class RubygemsIntegration
has 74 methods (exceeds 20 allowed). Consider refactoring. Open
class RubygemsIntegration
if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
EXT_LOCK = Gem::Ext::Builder::CHDIR_MONITOR
else
require "monitor"
Class Definition
has 67 methods (exceeds 20 allowed). Consider refactoring. Open
class Definition
include GemHelpers
attr_reader(
:dependencies,
Method converge_locked_specs
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def converge_locked_specs
deps = []
# Build a list of dependencies that are the same in the Gemfile
# and Gemfile.lock. If the Gemfile modified a dependency, but
- 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 58 (exceeds 5 allowed). Consider refactoring. Open
def run
Bundler.ui.level = "error" 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
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
File bundler.rb
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "bundler/vendored_fileutils"
require "pathname"
require "rbconfig"
require_relative "bundler/errors"
File rubygems_integration.rb
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rubygems" unless defined?(Gem)
module Bundler
class RubygemsIntegration
if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
Method gem
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def gem(name, *args)
options = args.last.is_a?(Hash) ? args.pop.dup : {}
options["gemfile"] = @gemfile
version = args || [">= 0"]
- 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 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "dependency"
require_relative "ruby_dsl"
module Bundler
class Dsl
Method run
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def run
Bundler.ui.confirm "Creating gem '#{name}'..."
underscored_name = name.tr("-", "_")
namespaced_path = name.tr("-", "/")
- 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 41 (exceeds 5 allowed). Consider refactoring. Open
def run
Bundler.ui.level = "error" if options[:quiet]
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
- 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 Rubygems
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class Rubygems < Source
autoload :Remote, File.expand_path("rubygems/remote", __dir__)
# Use the API when installing less than X gems
API_REQUEST_LIMIT = 500
Method install
has a Cognitive Complexity of 40 (exceeds 5 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)
- 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 version_conflict_message
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def version_conflict_message(e)
# only show essential conflicts, if possible
conflicts = e.conflicts.dup
conflicts.delete_if do |_name, conflict|
deps = conflict.requirement_trees.map(&:last).flatten(1)
- 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 rubygems.rb
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rubygems/user_interaction"
module Bundler
class Source
class Rubygems < Source
Class CLI
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class CLI < Thor
require_relative "cli/common"
package_name "Bundler"
Class Settings
has 40 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__)
Method require
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def require(*groups)
groups.map!(&:to_sym)
groups = [:default] if groups.empty?
@definition.dependencies.each 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"