Class Tuple
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Tuple
include Enumerable
def self.new(cnt)
Rubinius.primitive :tuple_allocate
File tuple.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Rubinius
class Tuple
include Enumerable
def self.new(cnt)
Method delete
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def delete(start, length, object)
Rubinius.primitive :tuple_delete_inplace
start = Rubinius::Type.coerce_to start, Fixnum, :to_i
length = Rubinius::Type.coerce_to length, Fixnum, :to_i
- 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 delete
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete(start, length, object)
Rubinius.primitive :tuple_delete_inplace
start = Rubinius::Type.coerce_to start, Fixnum, :to_i
length = Rubinius::Type.coerce_to length, Fixnum, :to_i
Method copy_from
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def copy_from(other, start, length, dest)
Rubinius.primitive :tuple_copy_from
unless other.kind_of? Rubinius::Tuple
raise TypeError, "Tuple#copy_from was expecting a Tuple, not a #{other.class}"
Method copy_from
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def copy_from(other, start, length, dest)
Rubinius.primitive :tuple_copy_from
unless other.kind_of? Rubinius::Tuple
raise TypeError, "Tuple#copy_from was expecting a Tuple, not a #{other.class}"
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def ==(tup)
return super unless tup.kind_of?(Tuple)
t = fields()
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def ===(other)
return false unless Tuple === other and fields == other.fields
i = 0
while i < fields
return false unless at(i) === other.at(i)
- 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"