Showing 12 of 12 total issues
Method mov
has a Cognitive Complexity of 39 (exceeds 10 allowed). Consider refactoring. Open
def mov(dst, src, stack_allowed: true)
raise ArgumentError, "#{dst} is not a register" unless register?(dst)
dst = get_register(dst)
if register?(src)
- 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 hexdump_iter
has a Cognitive Complexity of 35 (exceeds 10 allowed). Consider refactoring. Open
def hexdump_iter(io, width: 16, skip: true, offset: 0, style: {}, highlight: '')
Enumerator.new do |y|
style = DEFAULT_STYLE.merge(style)
highlight.bytes.each { |b| style[b] = HIGHLIGHT_STYLE }
(0..255).each do |b|
- 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 mov
has a Cognitive Complexity of 33 (exceeds 10 allowed). Consider refactoring. Open
def mov(dst, src, stack_allowed: true)
raise ArgumentError, "#{dst} is not a register" unless register?(dst)
dst = get_register(dst)
raise ArgumentError, "cannot use #{dst} on i386" if dst.size > 32 || dst.is64bit
- 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 pack
has a Cognitive Complexity of 33 (exceeds 10 allowed). Consider refactoring. Open
def pack(number, bits: nil, endian: nil, signed: nil)
if bits == 'all'
bits = nil
is_all = true
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
Method bits
has a Cognitive Complexity of 26 (exceeds 10 allowed). Consider refactoring. Open
def bits(s, endian: 'big', zero: 0, one: 1)
context.local(endian: endian) do
is_little = context.endian == 'little'
case s
when 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 recvuntil
has a Cognitive Complexity of 25 (exceeds 10 allowed). Consider refactoring. Open
def recvuntil(delims, drop: false, timeout: nil)
delims = Array(delims)
max_len = delims.map(&:size).max
@timer.countdown(timeout) do
data = Buffer.new
- 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 regsort
has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring. Open
def regsort(in_out, all_regs, randomize: nil)
# randomize = context.randomize if randomize.nil?
# TODO(david942j): stringify_keys
in_out = in_out.transform_keys(&:to_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
Method setregs
has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring. Open
def setregs(reg_context, stack_allowed: true)
abi = ::Pwnlib::ABI::ABI.default
reg_context = reg_context.reject { |_, v| v.nil? }
# convert all registers to string
reg_context = reg_context.map do |k, v|
- 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 pushstr
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def pushstr(str, append_null: true)
# This will not affect callee's +str+.
str += "\x00" if append_null && !str.end_with?("\x00")
return if str.empty?
- 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 load_symbols
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def load_symbols
@symbols = OpenStruct.new
@elf_file.each_sections do |section|
next unless section.respond_to?(:symbols)
- 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 pushstr
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def pushstr(str, append_null: true)
# This will not affect callee's +str+.
str += "\x00" if append_null && !str.end_with?("\x00")
return if str.empty?
- 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 recvpred
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def recvpred(timeout: nil)
raise ArgumentError, 'Need a block for recvpred' unless block_given?
@timer.countdown(timeout) do
data = +''
- 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"