Showing 1,079 of 1,541 total issues
Method parse
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def parse(argv=ARGV)
argv = Array(argv).dup
while entry = argv.shift
# collect everything that is not an option
- 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 rindex
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def rindex(sub, finish=undefined)
if undefined.equal?(finish)
finish = size
else
finish = Rubinius::Type.coerce_to(finish, Integer, :to_int)
- 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 validate_and_convert_argument
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def self.validate_and_convert_argument(objects)
if objects
raise TypeError, "Argument must be an Array" unless objects.respond_to?(:to_ary)
objects =
objects.to_ary.map do |obj|
- 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 **
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def **(other)
if other.kind_of?(Rational) && other.denominator == 1
other = other.numerator
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
Method glob
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def self.glob(pattern, flags, matches=[])
# Rubygems uses Dir[] as a glorified File.exist? to check for multiple
# extensions. So we went ahead and sped up that specific case.
if flags == 0 and
- 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 resolution.rb
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Gem::Resolver::Molinillo
class Resolver
# A specific resolution from a given {Resolver}
class Resolution
# A conflict that the resolution process encountered
Class Resolution
has 30 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
Class MSpecOptions
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class MSpecOptions
# Raised if incorrect or incomplete formats are passed to #on.
class OptionError < Exception; end
# Raised if an unrecognized option is encountered.
File dependency_installer.rb
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rubygems'
require 'rubygems/dependency_list'
require 'rubygems/package'
require 'rubygems/installer'
require 'rubygems/spec_fetcher'
File command.rb
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'optparse'
require 'rubygems/requirement'
require 'rubygems/user_interaction'
##
Method execute
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def execute
specs = []
gem = options[:args].shift
unless gem then
- 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 compose
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def self.compose(offset, p1, p2=nil, p3=nil, p4=nil, p5=nil, p6=nil, p7=nil,
yday=undefined, is_dst=undefined, tz=undefined)
if undefined.equal?(tz)
unless undefined.equal?(is_dst)
raise ArgumentError, "wrong number of arguments (9 for 1..8)"
- 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 to_sub_replacement
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def to_sub_replacement(result, match)
index = 0
while index < @num_bytes
current = index
while current < @num_bytes && @data[current] != 92 # ?\\
- 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 basename
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def self.basename(path, ext=undefined)
path = Rubinius::Type.coerce_to_path(path)
m = Rubinius::Mirror.reflect path
slash = "/"
- 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 set_encoding
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def set_encoding(external, internal=nil, options=undefined)
case external
when Encoding
@external = external
when String
- 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
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def parse(argv=ARGV)
argv = Array(argv)
while @parse and entry = argv.shift
# collect everything that is not an option
- 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 rational.rb
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Rational < Numeric
attr_reader :numerator
attr_reader :denominator
def *(other)
Method add_found_dependencies
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def add_found_dependencies to_do, dependency_list # :nodoc:
seen = {}
dependencies = Hash.new { |h, name| h[name] = Gem::Dependency.new name }
until to_do.empty? do
- 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 matches?
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def matches?(proc)
@saved_out = $stdout
@saved_err = $stderr
@stdout = $stdout = IOStub.new
@stderr = $stderr = IOStub.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
Method write_configure_files
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def write_configure_files
@log.write "\nWriting configuration files..."
@bin_links.delete @program_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"