Showing 1,541 of 1,541 total issues
Method fill
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def fill(a=undefined, b=undefined, c=undefined)
Rubinius.check_frozen
if block_given?
unless undefined.equal?(c)
- 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 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
def options
@options = Rubinius::Options.new "Usage: configure [options]", 30
o = @options
o.left_align
Method initialize
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def initialize(from, to, options=undefined)
@source_encoding = Rubinius::Type.coerce_to_encoding from
@destination_encoding = Rubinius::Type.coerce_to_encoding to
if options.kind_of? Fixnum
- 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 44 (exceeds 5 allowed). Consider refactoring. Open
def initialize(env_or_cmd, *args)
if options = Rubinius::Type.try_convert(args.last, ::Hash, :to_hash)
args.pop
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
File regexp.rb
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Regexp
def self.allocate
Rubinius.primitive :regexp_allocate
raise PrimitiveFailure, "Regexp.allocate primitive failed"
end
Class FileDescriptor
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class FileDescriptor
class RIOStream
def self.close(io, allow_exception)
Rubinius.primitive :rio_close
raise PrimitiveFailure, "IO::FileDescriptor::RIOStream.close primitive failed"
File encoding.rb
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
class EncodingError < StandardError
end
class Encoding
class UndefinedConversionError < EncodingError
File setup_command.rb
has 441 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rubygems/command'
##
# Installs RubyGems itself. This command is ordinarily only available from a
# RubyGems checkout or tarball.
File float.rb
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Float < Numeric
def **(other)
Rubinius.primitive :float_pow
if other.is_a?(Float) && self < 0 && other != other.round
Method options
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def options(argv=ARGV)
@stage = "processing command line arguments"
options = Options.new "Usage: rbx [subcommand] [options] [--] [script] [arguments]", 25
- 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 State
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class State
def initialize(stream, depth, proc)
# shared
@links = Rubinius::LookupTable.new
Method add_install_update_options
has 153 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 compiled_code.rb
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Rubinius
class CompiledCode < Executable
def self.allocate
Rubinius.primitive :compiledcode_allocate
raise PrimitiveFailure, "CompiledCode.allocate primitive failed"
Method download
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def download(spec, source_uri, install_dir = Gem.dir)
cache_dir =
if Dir.pwd == install_dir then # see fetch_command
install_dir
elsif File.writable? install_dir 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 layout
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def self.layout(*spec)
return @layout if spec.size == 0
# Pick up a enclosing FFI::Library
@enclosing_module ||= find_nested_parent
- 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 40 (exceeds 5 allowed). Consider refactoring. Open
def [](arg1, arg2=nil)
case arg1
# This is split out from the generic case and put first because
# it is by far the most common case and we want to deal with it
- 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 resolve_for
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def resolve_for needed, specs
while needed
dep = needed.value
needed = needed.tail
- 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_filesystem_paths
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def set_filesystem_paths
@prefixdir = @prefixdir ? expand_install_dir(@prefixdir) : @sourcedir
if @appdir
dir = expand_install_dir @appdir
- 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 Installer
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::Installer
##
# Paths where env(1) might live. Some systems are broken and have it in
# /bin
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],