david942j/patchelf.rb

View on GitHub
lib/patchelf/alt_saver.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
96%

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'
Severity: Major
Found in lib/patchelf/alt_saver.rb - About 1 day to fix

    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
    
    
    Severity: Minor
    Found in lib/patchelf/alt_saver.rb - About 1 hr to fix

    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
    
    
    Severity: Minor
    Found in lib/patchelf/alt_saver.rb - About 1 hr to fix

    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
    
    
    Severity: Minor
    Found in lib/patchelf/alt_saver.rb - About 35 mins to fix

    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

    There are no issues that match your filters.

    Category
    Status