Showing 1,321 of 1,541 total issues
Class Array
has 105 methods (exceeds 20 allowed). Consider refactoring. Open
class Array
include Enumerable
def self.allocate
Rubinius.primitive :array_allocate
File kernel.rb
has 836 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Kernel
def equal?(other)
Rubinius.primitive :object_equal
raise PrimitiveFailure, "Kernel#equal? primitive failed"
end
Method parse_stream
has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring. Open
def parse_stream(f)
class_pattern = /class\s+([^\s]+)\s*:\s*public\s+([^\s]+)/
slot_pattern = %r!^\s*(\w+)\*?\s+\*?_(\w+)_\s*;\s*//\s*slot(.*)!
accessor_pattern = %r!^\s*attr_(accessor|reader|writer)\((\w+),\s*(\w+)\)!
primitive_pattern = %r%^\s*//\s+Rubinius.primitive([?!\+])?\s+:(.*)\s*$%
- 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 hash.rb
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Hash
include Enumerable
Vector = Rubinius::Tuple
File file.rb
has 730 lines of code (exceeds 250 allowed). Consider refactoring. Open
class File < IO
include Enumerable
class FileError < Exception; end
class NoFileError < FileError; end
File enumerable.rb
has 709 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Enumerable
def chunk
raise ArgumentError, "no block given" unless block_given?
::Enumerator.new do |yielder|
previous = nil
Class Configure
has 82 methods (exceeds 20 allowed). Consider refactoring. Open
class Configure
# Default settings only. All code that may depend on user-selected options
# must run after options are processed.
def initialize(root)
File rubygems.rb
has 676 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rbconfig'
require 'thread'
module Gem
VERSION = "2.7.5"
File loader.rb
has 660 lines of code (exceeds 250 allowed). Consider refactoring. Open
TOPLEVEL_BINDING = binding()
module Rubinius
class Loader
def initialize
Method set_index
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def set_index(index, ent, fin=undefined)
Rubinius.primitive :array_aset
Rubinius.check_frozen
- 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 File
has 76 methods (exceeds 20 allowed). Consider refactoring. Open
class File < IO
include Enumerable
class FileError < Exception; end
class NoFileError < FileError; end
File server.rb
has 638 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'webrick'
require 'zlib'
require 'erb'
require 'uri'
Class TestCase
has 71 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::TestCase < MiniTest::Unit::TestCase
attr_accessor :fetcher # :nodoc:
attr_accessor :gem_repo # :nodoc:
File type.rb
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Rubinius
module Type
# Performs a direct kind_of? check on the object bypassing any method
# overrides.
def self.object_kind_of?(obj, cls)
Method inspect
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
def inspect
result_encoding = Encoding.default_internal || Encoding.default_external
unless result_encoding.ascii_compatible?
result_encoding = Encoding::US_ASCII
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 process.rb
has 575 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Process
def self.time
Rubinius.primitive :vm_time
raise PrimitiveFailure, "Process.time primitive failed"
end
File module.rb
has 571 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Module
attr_reader :constant_table
attr_writer :method_table
Method []=
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
def []=(index, count_or_replacement, replacement=undefined)
if undefined.equal?(replacement)
replacement = count_or_replacement
count = nil
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
File pointer_accessors.rb
has 558 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Rubinius
module FFI
##
# This module provides accessors for various different types. It
# provides methods for:
Method constant_scope_defined?
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def self.constant_scope_defined?(scope, name)
current = scope
until nil.equal? current
break if nil.equal? current.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"