core/pointer.rb
Class Pointer
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Pointer
include PointerAccessors
def initialize(a1, a2=undefined)
if undefined.equal? a2
File pointer.rb
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Rubinius
module FFI
# We need to define this so we can include it. Since the file is
# auto-generated, we can't pull it in here but we don't want to break the
# alphabetized load order for random cases.
Method new
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.new(type, count=nil, clear=true)
if type.kind_of? Fixnum
size = type
elsif type.kind_of? Symbol
type = FFI.find_type type
Method new
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.new(type, count=nil, clear=true)
if type.kind_of? Fixnum
size = type
elsif type.kind_of? Symbol
type = FFI.find_type type
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(ret_type, arg_types, val=nil, options=nil, &block)
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def initialize(ret_type, arg_types, val=nil, options=nil, &block)
if block
if val or options
raise ArgumentError, "specify a block or a proc/address, not both"
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"