hackedteam/test-av

View on GitHub

Showing 1,005 of 1,471 total issues

Consider simplifying this complex logical expression.
Open

        if (
            self.Image_Name is not None or
            self.Start_Username is not None or
            self.Current_Directory is not None or
            self.Command_Line is not None or
Severity: Critical
Found in lib/maec/maec11.py - About 2 hrs to fix

    ToolType has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ToolType(GeneratedsSuper):
        """ToolType is intended to provide a way of characterizing any tools
        used in the analysis of malware."""
        subclass = None
        superclass = None
    Severity: Minor
    Found in lib/maec/maec11.py - About 2 hrs to fix

      Packer_TypeType has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Packer_TypeType(GeneratedsSuper):
          """This is intended to characterize the type of packer characterized in
          this element. Possible values: Archiver, Installer, Self-
          Extracting_Archiver, Crypter, Packer, Protector, Bundler, Other."""
          subclass = None
      Severity: Minor
      Found in lib/maec/maec11.py - About 2 hrs to fix

        Daemon_Object_AttributesType has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Daemon_Object_AttributesType(GeneratedsSuper):
            subclass = None
            superclass = None
            def __init__(self, Service_Type=None, Start_Type=None, Display_Name=None, Daemon_Binary_Object=None, Load_Order_Group=None):
                self.Service_Type = Service_Type
        Severity: Minor
        Found in lib/maec/maec11.py - About 2 hrs to fix

          classificationDetailsType has 22 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class classificationDetailsType(GeneratedsSuper):
              subclass = None
              superclass = None
              def __init__(self, definitionVersion=None, detectionAddedTimeStamp=None, detectionShippedTimeStamp=None, product=None, productVersion=None):
                  self.definitionVersion = definitionVersion
          Severity: Minor
          Found in lib/maec/maec11.py - About 2 hrs to fix

            objectProperty has 22 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class objectProperty(GeneratedsSuper):
                """Property; a reference to the object, a timestamp and an unbounded
                set of properties. This is used to describe extra information
                about an object. For example, to show the url parameter strings
                associated with a particular URI object. Or to show file names
            Severity: Minor
            Found in lib/maec/maec11.py - About 2 hrs to fix

              PE_HeaderType has 22 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class PE_HeaderType(GeneratedsSuper):
                  subclass = None
                  superclass = None
                  def __init__(self, Hashes=None, Entropy=None, Signature=None, File_Header=None, Optional_Header=None):
                      self.Hashes = Hashes
              Severity: Minor
              Found in lib/maec/maec11.py - About 2 hrs to fix

                EffectType has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class EffectType(GeneratedsSuper):
                    """EffectType is intended to serve as a method for the characterization
                    of the results of succesfully executed actions and behaviors."""
                    subclass = None
                    superclass = None
                Severity: Minor
                Found in lib/maec/maec11.py - About 2 hrs to fix

                  PEStringType has 22 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PEStringType(GeneratedsSuper):
                      """PEStringType is intended as container for strings extracted from PE
                      binaries.The address attribute refers to the location of the
                      specified string in the PE binary.The encoding attribute refers
                      to the encoding method used for the string extracted from the PE
                  Severity: Minor
                  Found in lib/maec/maec11.py - About 2 hrs to fix

                    DataType has 22 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class DataType(GeneratedsSuper):
                        """DataType is intended to provide a relatively abstract way of
                        characterizing data segments that may be
                        written/read/transmitted or otherwise utilized in actions or
                        behaviors. The format attribute refers to the type of data
                    Severity: Minor
                    Found in lib/maec/maec11.py - About 2 hrs to fix

                      PEImportType has 22 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class PEImportType(GeneratedsSuper):
                          """PEImportType is intended as container for the attributes relevant to
                          PE binary imports.The type attribute refers to the type of
                          import, with regards to being initially visible or hidden in
                          relation to PE binary packing. A packed binary will typically
                      Severity: Minor
                      Found in lib/maec/maec11.py - About 2 hrs to fix

                        Function match has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def match(self, environ):
                                ''' Return a (target, url_agrs) tuple or raise HTTPError(400/404/405). '''
                                path, targets, urlargs = environ['PATH_INFO'] or '/', None, {}
                                if path in self.static:
                                    targets = self.static[path]
                        Severity: Minor
                        Found in lib/bottle.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 exportLiteralChildren has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def exportLiteralChildren(self, outfile, level, name_):
                                showIndent(outfile, level)
                                outfile.write('file=[\n')
                                level += 1
                                for file_ in self.file:
                        Severity: Major
                        Found in lib/maec/maec11.py - About 2 hrs to fix

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

                              def __init__(self, type_=None, id=None, API_Call=None, Code=None, Platform=None, Data_Read=None, Data_Written=None, File_System_Action_Attributes=None, IPC_Action_Attributes=None, Process_Action_Attributes=None, Memory_Action_Attributes=None, Registry_Action_Attributes=None, Network_Action_Attributes=None, Module_Action_Attributes=None, Daemon_Action_Attributes=None, System_Action_Attributes=None, Internet_Action_Attributes=None):
                          Severity: Major
                          Found in lib/maec/maec11.py - About 2 hrs to fix

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

                                def set_cookie(self, name, value, secret=None, **options):
                                    ''' Create a new cookie or replace an old one. If the `secret` parameter is
                                        set, create a `Signed Cookie` (described below).
                            
                                        :param name: the name of the cookie.
                            Severity: Minor
                            Found in lib/bottle.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 is_suspicious has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def is_suspicious( pe ):
                                """
                                unusual locations of import tables
                                non recognized section names
                                presence of long ASCII strings
                            Severity: Minor
                            Found in lib/pefile/peutils.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 a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def __init__(self, file=None, uri=None, domain=None, registry=None, ip=None, asn=None, entity=None, classification=None):
                                    if file is None:
                                        self.file = []
                                    else:
                                        self.file = file
                            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_='Data_DirectoryType', fromsubclass_=False):
                                    if self.Export_Symbols is not None:
                                        self.Export_Symbols.export(outfile, level, namespace_, name_='Export_Symbols')
                                    if self.Import_Symbols is not None:
                                        self.Import_Symbols.export(outfile, level, namespace_, name_='Import_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 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

                            Severity
                            Category
                            Status
                            Source
                            Language