trailofbits/bisc

View on GitHub

Showing 6 of 6 total issues

Method add_module has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def add_module(path)
      elf = BISC::ELF::Executable.new(path)
      elfname = File.basename(path)
      @modules[elfname] = elf

Severity: Minor
Found in lib/bisc/elf_assembler.rb - About 2 hrs 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 add_module has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def add_module(path)
      pe = Rex::PeParsey::Pe.new_from_file(path, true)
      pename = File.basename(path)
      @modules[pename] = pe

Severity: Minor
Found in lib/bisc/assembler.rb - About 2 hrs 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 add_module has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def add_module(path)
      pe = Rex::PeParsey::Pe.new_from_file(path, true)
      pename = File.basename(path)
      @modules[pename] = pe

Severity: Minor
Found in lib/bisc/assembler.rb - About 1 hr to fix

    Method add_module has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def add_module(path)
          elf = BISC::ELF::Executable.new(path)
          elfname = File.basename(path)
          @modules[elfname] = elf
    
    
    Severity: Minor
    Found in lib/bisc/elf_assembler.rb - About 1 hr to fix

      Method get_iat_pointer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_iat_pointer(dll_name, function_name)
            @modules.values.each do |pe|
              pe.imports.each do |import|
                if import.name.casecmp(dll_name) == 0
                  import.entries.each_with_index { |entry, i|
      Severity: Minor
      Found in lib/bisc/assembler.rb - About 45 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

      Method [] has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def [](s)
            case s
            when Symbol
              addresses = @instructions[s]
      
      
      Severity: Minor
      Found in lib/bisc/assembler.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

      Severity
      Category
      Status
      Source
      Language