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"
Class CompiledCode
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class CompiledCode < Executable
def self.allocate
Rubinius.primitive :compiledcode_allocate
raise PrimitiveFailure, "CompiledCode.allocate primitive failed"
end
Method first_ip_on_line
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def first_ip_on_line(line, start=nil)
i = 1
total = @lines.size
while i < total
- 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 add_metadata
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_metadata(key, val)
raise TypeError, "key must be a symbol" unless key.kind_of? Symbol
case val
when true, false, Symbol, Fixnum, String
Method locate_line
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def locate_line(line)
i = 1
total = @lines.size
while i < total
cur_line = @lines.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"
Further reading
Method parameters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parameters
params = []
return params unless respond_to?(:local_names)
- 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 add_metadata
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_metadata(key, val)
raise TypeError, "key must be a symbol" unless key.kind_of? Symbol
case val
when true, false, Symbol, Fixnum, String
- 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 line_from_ip
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def line_from_ip(ip)
return -1 unless @lines
return 0 if @lines.size < 2
low = 0
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(inst, code, ip)
@instruction = inst[0]
@args = inst[1..-1]
@comment = 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"