hackedteam/test-av

View on GitHub

Showing 1,005 of 1,471 total issues

Function exportLiteralChildren has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def exportLiteralChildren(self, outfile, level, name_):
        if self.Export_Symbols is not None:
            showIndent(outfile, level)
            outfile.write('Export_Symbols=model_.PEDataDirectoryStruct(\n')
            self.Export_Symbols.exportLiteral(outfile, level, name_='Export_Symbols')
Severity: Minor
Found in lib/maec/maec11.py - 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

Function exportChildren has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def exportChildren(self, outfile, level, namespace_='maec:', name_='DOS_HeaderType', fromsubclass_=False):
        if self.Hashes is not None:
            self.Hashes.export(outfile, level, namespace_, name_='Hashes')
        if self.signature is not None:
            self.signature.export(outfile, level, namespace_, name_='signature')
Severity: Minor
Found in lib/maec/maec11.py - 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

Function buildChildren has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Hashes':
            obj_ = HashesType1.factory()
            obj_.build(child_)
            self.set_Hashes(obj_)
Severity: Minor
Found in lib/maec/maec11.py - 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

Function __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, Hashes=None, signature=None, lastsize=None, nblocks=None, nreloc=None, hdrsize=None, minalloc=None, maxalloc=None, checksum=None, relocpos=None, noverlay=None, reserved1=None, oem_id=None, oem_info=None, reserved2=None, e_lfanew=None):
Severity: Major
Found in lib/maec/maec11.py - About 2 hrs to fix

    Function __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, Export_Symbols=None, Import_Symbols=None, Resources=None, Exception=None, Security=None, Base_Relocation=None, Debug=None, Architecture=None, Copyright_String=None, Unknown=None, Thread_Local_Storage=None, Load_Configuration=None, Bound_Import=None, Import_Address_Table=None, Delay_Import=None, COM_Descriptor=None):
    Severity: Major
    Found in lib/maec/maec11.py - About 2 hrs to fix

      Function run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(self):
              exists = os.path.exists
              mtime = lambda path: os.stat(path).st_mtime
              files = dict()
      
      
      Severity: Minor
      Found in lib/bottle.py - 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

      Function run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(self):
              """Run handler.
              @return: operation status.
              """
              data = ""
      Severity: Minor
      Found in analyzer/windows/analyzer.py - 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

      Function gen_proclist has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def gen_proclist(self):
              """Generate processes list.
              @return: True.
              """
              for entry in self.proc_results:
      Severity: Minor
      Found in modules/processing/behavior.py - 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

      Function parse_directory_bound_imports has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def parse_directory_bound_imports(self, rva, size):
              """"""
              
              bnd_descr = Structure(self.__IMAGE_BOUND_IMPORT_DESCRIPTOR_format__)
              bnd_descr_size = bnd_descr.sizeof()
      Severity: Minor
      Found in lib/pefile/pefile.py - 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

      Function relocate_image has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def relocate_image(self, new_ImageBase):
              """Apply the relocation information to the image using the provided new image base.
              
              This method will apply the relocation information to the image. Given the new base,
              all the relocations will be processed and both the raw data and the section's data
      Severity: Minor
      Found in lib/pefile/pefile.py - 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

      Function buildChildren has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
              if nodeName_ == 'API_Call':
                  obj_ = APICallType.factory()
                  obj_.build(child_)
                  self.set_API_Call(obj_)
      Severity: Minor
      Found in lib/maec/maec11.py - 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

      Function exportLiteralChildren has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def exportLiteralChildren(self, outfile, level, name_):
              if self.Object_Size is not None:
                  showIndent(outfile, level)
                  outfile.write('Object_Size=model_.Object_SizeType(\n')
                  self.Object_Size.exportLiteral(outfile, level, name_='Object_Size')
      Severity: Minor
      Found in lib/maec/maec11.py - 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

      Function buildChildren has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
              if nodeName_ == 'Object_Size':
                  obj_ = Object_SizeType.factory()
                  obj_.build(child_)
                  self.set_Object_Size(obj_)
      Severity: Minor
      Found in lib/maec/maec11.py - 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

      Function exportChildren has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionImplementationType', fromsubclass_=False):
              if self.API_Call is not None:
                  self.API_Call.export(outfile, level, namespace_, name_='API_Call')
              for Code_ in self.Code:
                  Code_.export(outfile, level, namespace_, name_='Code')
      Severity: Minor
      Found in lib/maec/maec11.py - 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

      Function buildChildren has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
              if nodeName_ == 'Hashes':
                  obj_ = HashesType5.factory()
                  obj_.build(child_)
                  self.set_Hashes(obj_)
      Severity: Minor
      Found in lib/maec/maec11.py - 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

      Function exportLiteralChildren has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def exportLiteralChildren(self, outfile, level, name_):
              if self.API_Call is not None:
                  showIndent(outfile, level)
                  outfile.write('API_Call=model_.APICallType(\n')
                  self.API_Call.exportLiteral(outfile, level, name_='API_Call')
      Severity: Minor
      Found in lib/maec/maec11.py - 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

      Function exportChildren has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectType', fromsubclass_=False):
              if self.Object_Size is not None:
                  self.Object_Size.export(outfile, level, namespace_, name_='Object_Size')
              if self.Classifications is not None:
                  self.Classifications.export(outfile, level, namespace_, name_='Classifications')
      Severity: Minor
      Found in lib/maec/maec11.py - 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

      Function _run_signature has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def _run_signature(self, signature, results):
              """Run a signature.
              @param signature: signature to run.
              @param signs: signature results dict.
              @return: matched signature.
      Severity: Minor
      Found in lib/cuckoo/core/processor.py - 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

      Function inject has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def inject(self, dll=os.path.join("dll", "cuckoomon.dll"), apc=False):
              """Cuckoo DLL injection.
              @param dll: Cuckoo DLL path.
              @param apc: APC use.
              """
      Severity: Minor
      Found in analyzer/windows/lib/api/process.py - 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

      Function get_memory_mapped_image has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_memory_mapped_image(self, max_virtual_address=0x10000000, ImageBase=None):
              """Returns the data corresponding to the memory layout of the PE file.
              
              The data includes the PE header and the sections loaded at offsets
              corresponding to their relative virtual addresses. (the VirtualAddress
      Severity: Minor
      Found in lib/pefile/pefile.py - 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

      Severity
      Category
      Status
      Source
      Language