Showing 262 of 280 total issues
Class API
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class API
# This class provides the base to build source plugins
# All the method here are required to build a source plugin (except
# `uri_hash`, `gem_install_dir`; they are helpers).
#
Method version_conflict_message
has 75 lines of code (exceeds 25 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)
Class GemHelper
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class GemHelper
include Rake::DSL if defined? Rake::DSL
class << self
# set when install'd.
Class Path
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Path < Source
autoload :Installer, File.expand_path("path/installer", __dir__)
attr_reader :path, :options, :root_path, :original_path
attr_writer :name
Method run
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
Bundler.ui.level = "error" if options[:quiet]
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
Method initialize
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
if [true, false].include?(unlock)
@unlocking_bundler = false
@unlocking = unlock
else
Method verify_gemfile_dependencies_are_found!
has a Cognitive Complexity of 20 (exceeds 5 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?
- 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 sort_dep_specs
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def sort_dep_specs(spec_groups, locked_spec)
return spec_groups unless locked_spec
@gem_name = locked_spec.name
@locked_version = 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 run
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
Bundler.ui.level = "error" if options[:quiet]
warn_if_root
Class Index
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Index
include Enumerable
def self.build
i = new
Class Resolver
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Resolver
require_relative "vendored_molinillo"
require_relative "resolver/spec_group"
# Figures out the best possible configuration of gems that satisfies
Class SpecSet
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class SpecSet
include Enumerable
include TSort
def initialize(specs)
Method initialize
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
if [true, false].include?(unlock)
@unlocking_bundler = false
@unlocking = unlock
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 define_task
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.define_task(context, task_method = :task, opts = {})
if defined?(Capistrano) && context.is_a?(Capistrano::Configuration)
context_name = "capistrano"
role_default = "{:except => {:no_release => true}}"
error_type = ::Capistrano::CommandError
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
def run
Bundler.definition.validate_runtime!
path_option = options["path"]
path_option = nil if path_option && path_option.empty?
Bundler.settings.set_command_option :bin, path_option if options["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
File shared_helpers.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "pathname"
require "rbconfig"
require_relative "version"
require_relative "constants"
Method empty?
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.empty?(ranges, neqs)
!ranges.reduce(ReqR::UNIVERSAL) do |last_range, curr_range|
next false unless last_range
next false if curr_range.single? && neqs.include?(curr_range.left.version)
next curr_range if last_range.right.version == ReqR::INFINITY
- 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 build_gem_lines
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def build_gem_lines(conservative_versioning)
@deps.map do |d|
name = d.name.dump
requirement = if conservative_versioning
- 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_source
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def parse_source(line)
case line
when SPECS
case @type
when 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
Method ensure_equivalent_gemfile_and_lockfile
has 59 lines of code (exceeds 25 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."