Showing 1,321 of 1,541 total issues
Method validate
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def validate packaging = true
@warnings = 0
require 'rubygems/user_interaction'
extend Gem::UserInteraction
normalize
- 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 popen
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def self.popen(*args)
if env = Rubinius::Type.try_convert(args.first, Hash, :to_hash)
args.shift
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 options
has 222 lines of code (exceeds 25 allowed). Consider refactoring. Open
def options(argv=ARGV)
@stage = "processing command line arguments"
options = Options.new "Usage: rbx [subcommand] [options] [--] [script] [arguments]", 25
Class Module
has 61 methods (exceeds 20 allowed). Consider refactoring. Open
class Module
attr_reader :constant_table
attr_writer :method_table
Class Hash
has 60 methods (exceeds 20 allowed). Consider refactoring. Open
class Hash
include Enumerable
Vector = Rubinius::Tuple
Method normalize_options
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def self.normalize_options(mode, options)
mode = nil if undefined.equal?(mode)
autoclose = true
encoding_options = {}
- 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 split
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def self.split(string, pattern, limit)
# Odd edge case
return [] if string.empty?
tail_empty = false
- 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 sample
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def sample(count=undefined, options=undefined)
return at Kernel.rand(size) if undefined.equal? count
if undefined.equal? options
if o = Rubinius::Type.check_convert_type(count, Hash, :to_hash)
- 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 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write_configure_files
@log.write "\nWriting configuration files..."
@bin_links.delete @program_name
Method tr_trans
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def tr_trans(source, replacement, squeeze)
source = StringValue(source).dup
replacement = StringValue(replacement).dup
return delete!(source) if replacement.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
Class Time
has 54 methods (exceeds 20 allowed). Consider refactoring. Open
class Time
include Comparable
def self.now
Rubinius.primitive :time_s_now
Class Integer
has 54 methods (exceeds 20 allowed). Consider refactoring. Open
class Integer < Numeric
def self.===(obj)
Rubinius.asm do
int = new_label
done = new_label
Method gsub
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def gsub(pattern, replacement=undefined)
# Because of the behavior of $~, this is duplicated from gsub! because
# if we call gsub! from gsub, the last_match can't be updated properly.
unless valid_encoding?
- 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 installer.rb
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rubygems/command'
require 'rubygems/exceptions'
require 'rubygems/package'
require 'rubygems/ext'
require 'rubygems/user_interaction'
Method gsub!
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def gsub!(pattern, replacement=undefined)
# Because of the behavior of $~, this is duplicated from gsub! because
# if we call gsub! from gsub, the last_match can't be updated properly.
unless valid_encoding?
- 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 Stat
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
class Stat
include Comparable
attr_reader :path
Method compile
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def self.compile(pattern, flags=0, patterns=[])
escape = (flags & File::FNM_NOESCAPE) == 0
rbrace = nil
lbrace = nil
- 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 braces
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def self.braces(pattern, flags=0, patterns=[])
escape = (flags & FNM_NOESCAPE) == 0
rbrace = nil
lbrace = nil
- 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 slice!
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def slice!(start, length=undefined)
Rubinius.check_frozen
if undefined.equal? length
if start.kind_of? Range
- 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 Thread
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
class Thread
attr_reader :recursive_objects
attr_reader :pid
attr_reader :exception
attr_reader :stack_size