Showing 830 of 946 total issues
Class Command
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::Command
include Gem::UserInteraction
Gem::OptionParser.accept Symbol, &:to_sym
Method gem
has a Cognitive Complexity of 39 (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
Method execute
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def execute
specs = if options[:all]
Gem::Specification.map
# `--extensions` must be explicitly given to pristine only gems
- 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 gem_dependency_api.rb
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Gem::RequestSet::GemDependencyAPI
ENGINE_MAP = { # :nodoc:
jruby: %w[jruby],
jruby_18: %w[jruby],
jruby_19: %w[jruby],
File protocol.rb
has 402 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'socket'
require_relative '../../../timeout/lib/timeout'
require 'io/wait'
module Gem::Net # :nodoc:
Method converge_specs
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def converge_specs(specs)
converged = []
deps = []
@specs_that_changed_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
File rubygems_integration.rb
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rubygems" unless defined?(Gem)
module Bundler
class RubygemsIntegration
require "monitor"
Method doctor_child
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def doctor_child(sub_directory, extension) # :nodoc:
directory = File.join(@gem_repository, sub_directory)
Dir.entries(directory).sort.each do |ent|
next if [".", ".."].include?(ent)
- 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 add_install_update_options
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_install_update_options
add_option(:"Install/Update", "-i", "--install-dir DIR",
"Gem repository directory to get installed",
"gems") do |value, options|
options[:install_dir] = File.expand_path(value)
File rubygems.rb
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rubygems/user_interaction"
module Bundler
class Source
class Rubygems < Source
Class Resolution
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Resolution
# A conflict that the resolution process encountered
# @attr [Object] requirement the requirement that immediately led to the conflict
# @attr [{String,Nil=>[Object]}] requirements the requirements that caused the conflict
# @attr [Object, nil] existing the existing spec that was in conflict with
File specification_policy.rb
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "user_interaction"
class Gem::SpecificationPolicy
include Gem::UserInteraction
Method download
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def download(spec, source_uri, install_dir = Gem.dir)
install_cache_dir = File.join install_dir, "cache"
cache_dir =
if Dir.pwd == install_dir # see fetch_command
install_dir
- 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 a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def initialize(m, reqbody, resbody, uri_or_path, initheader = nil) # :nodoc:
@method = m
@request_has_body = reqbody
@response_has_body = resbody
- 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 a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def install(options, &block) # :yields: request, installer
if dir = options[:install_dir]
requests = install_into dir, false, options, &block
return requests
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
Class SourceList
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class SourceList
attr_reader :path_sources,
:git_sources,
:plugin_sources,
:global_path_source,
File gem.rb
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "pathname"
module Bundler
class CLI
Bundler.require_thor_actions
Method make_switch
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_switch(opts, block = nil)
short, long, nolong, style, pattern, conv, not_pattern, not_conv, not_style = [], [], []
ldesc, sdesc, desc, arg = [], [], []
default_style = Switch::NoArgument
default_pattern = nil
Method build_gem_lines
has a Cognitive Complexity of 33 (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 run
has a Cognitive Complexity of 33 (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"