File alt_saver.rb
has 761 lines of code (exceeds 250 allowed). Consider refactoring. Wontfix
require 'elftools/constants'
require 'elftools/elf_file'
require 'elftools/structs'
require 'elftools/util'
require 'fileutils'
Method write_replaced_sections
has a Cognitive Complexity of 18 (exceeds 11 allowed). Consider refactoring. Wontfix
def write_replaced_sections(cur_off, start_addr, start_offset)
overwrite_replaced_sections
noted_phdrs = Set.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 sync_dyn_tags!
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Wontfix
def sync_dyn_tags!
dyn_table_offset = nil
each_dynamic_tags do |dyn, buf_off|
dyn_table_offset ||= buf_off
- 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 normalize_note_segment
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Wontfix
def normalize_note_segment(phdr)
start_off = phdr.p_offset.to_i
curr_off = start_off
end_off = start_off + phdr.p_filesz
- 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"