hackedteam/test-av

View on GitHub

Showing 1,005 of 1,471 total issues

Function get_options has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def get_options(self):
        """Get analysis options.
        @return: options dict.
        """
        options = {}
Severity: Minor
Found in analyzer/windows/analyzer.py - 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

Avoid deeply nested control flow statements.
Open

                        if argument["name"] == "Registry":
                            registry = int(argument["value"], 16)
                        elif argument["name"] == "SubKey":
                            subkey = argument["value"]
                        elif argument["name"] == "Handle":
Severity: Major
Found in modules/processing/behavior.py - About 45 mins to fix

    Function choose_package has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def choose_package(file_type):
        """Choose analysis package due to file type.
        @param file_type: file type.
        @return: package or None.
        """
    Severity: Minor
    Found in analyzer/windows/lib/core/packages.py - 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

    Function __generate_signature has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __generate_signature(self, pe, offset, name, ep_only=False,
    Severity: Minor
    Found in lib/pefile/peutils.py - About 45 mins to fix

      Function parse_resources_directory has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def parse_resources_directory(self, rva, size=0, base_rva = None, level = 0, dirs=None):
      Severity: Minor
      Found in lib/pefile/pefile.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if res['hostname'] == req.get_hostname():
                                    ip = res['ip']
                                    # Check if obj exist
                                    found = None
                                    for obj in self.objects.get_ip():
        Severity: Major
        Found in modules/reporting/metadata.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if argument["name"] == "MutexName":
                                      if argument["value"] not in mutexes:
                                          mutexes.append(argument["value"])
          
          
          Severity: Major
          Found in modules/processing/behavior.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        for st_entry in entry.StringTable:
                                            for str_entry in st_entry.entries.items():
                                                entry = {}
                                                entry["name"] = convert_to_printable(str_entry[0])
                                                entry["value"] = convert_to_printable(str_entry[1])
            Severity: Major
            Found in modules/processing/static.py - About 45 mins to fix

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

                  def run(self):
                      idx = 1
                      # creating a file .pid
                      #self.lock_file = '/tmp/lock.pid'
                      #self.lock_file = 'C:\\WINDOWS\Temp\\lock.pid'
              Severity: Minor
              Found in lib/cuckoo/core/screener.py - 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

              Avoid deeply nested control flow statements.
              Open

                                          for var_entry in entry.Var:
                                              if hasattr(var_entry, "entry"):
                                                  entry = {}
                                                  entry["name"] = convert_to_printable(var_entry.entry.keys()[0])
                                                  entry["value"] = convert_to_printable(var_entry.entry.values()[0])
              Severity: Major
              Found in modules/processing/static.py - About 45 mins to fix

                Function match_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def match_data(self, code_data, ep_only=True, section_start_only=False):
                
                        data = code_data
                        scan_addresses = [ 0 ]
                
                
                Severity: Minor
                Found in lib/pefile/peutils.py - 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

                Avoid deeply nested control flow statements.
                Open

                                            if hasattr(resource_id, "directory"):
                                                for resource_lang in resource_id.directory.entries:
                                                    data = self.pe.get_data(resource_lang.data.struct.OffsetToData, resource_lang.data.struct.Size)
                                                    filetype = self._get_filetype(data)
                                                    language = pefile.LANG.get(resource_lang.data.lang, None)
                Severity: Major
                Found in modules/processing/static.py - About 45 mins to fix

                  Function doUpdate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def doUpdate(self, vmx):
                          if vmx == 'all':
                              #update all vms
                              vms = self.conf.getMachines()
                              
                  Severity: Minor
                  Found in utils/manager/win_updates.py - 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

                  Avoid deeply nested control flow statements.
                  Open

                                              if self._check_dns(udp.data):
                                                  self._add_dns(udp.data)
                  
                  
                  Severity: Major
                  Found in modules/processing/network.py - About 45 mins to fix

                    Function complete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def complete(self, task_id, success=True):
                            """Mark a task as completed.
                            @param task_id: task id.
                            @param success: completed with status.
                            @return: operation status.
                    Severity: Minor
                    Found in lib/cuckoo/core/database.py - 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

                    Function uninstall has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def uninstall(self, plugin):
                            ''' Uninstall plugins. Pass an instance to remove a specific plugin, a type
                                object to remove all plugins that match that type, a string to remove
                                all plugins with a matching ``name`` attribute or ``True`` to remove all
                                plugins. Return the list of removed plugins. '''
                    Severity: Minor
                    Found in lib/bottle.py - 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

                    Avoid deeply nested control flow statements.
                    Open

                                            if argument["name"] == "FileName":
                                                if argument["value"] not in files:
                                                    files.append(argument["value"])
                    
                    
                    Severity: Major
                    Found in modules/processing/behavior.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              while entry_offset < stringtable_offset + stringtable_struct.Length:
                                                  
                                                  string_struct = self.__unpack_data__(
                                                      self.__String_format__, raw_data[entry_offset:],
                                                      file_offset = start_offset+entry_offset )
                      Severity: Major
                      Found in lib/pefile/pefile.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if new_stringtable_offset == stringtable_offset:
                                                    break
                                                stringtable_offset = new_stringtable_offset
                        Severity: Major
                        Found in lib/pefile/pefile.py - About 45 mins to fix

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

                              def __init__(self, Text_Title=None, Text=None, Code_Example_Language=None, Code=None, Images=None, Block=None):
                          Severity: Minor
                          Found in lib/maec/maec11.py - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language