hackedteam/test-av

View on GitHub

Showing 1,005 of 1,471 total issues

Consider simplifying this complex logical expression.
Open

        if (
            self.Object_Size is not None or
            self.Classifications is not None or
            self.Associated_Code is not None or
            self.Related_Objects is not None or
Severity: Critical
Found in lib/maec/maec11.py - About 3 hrs to fix

    Network_Object_AttributesType has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Network_Object_AttributesType(GeneratedsSuper):
        subclass = None
        superclass = None
        def __init__(self, Internal_Port=None, External_Port=None, Socket_Type=None, Socket_ID=None, Internal_IP_Address=None, External_IP_Address=None, IP_Protocol=None, Application_Layer_Protocol=None):
            self.Internal_Port = Internal_Port
    Severity: Minor
    Found in lib/maec/maec11.py - About 3 hrs to fix

      uriObject has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class uriObject(GeneratedsSuper):
          """Uri object. Only required element is uri string itself. There are
          elements for each of the broken out elements. The protocol
          should be take from the list at http://www.iana.org/assignments
          /port-numbers, or if not in that list have the value 'unknown'.
      Severity: Minor
      Found in lib/maec/maec11.py - About 3 hrs to fix

        Function _cast has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def _cast(self, out, peek=None):
                """ Try to convert the parameter into something WSGI compatible and set
                correct HTTP headers when possible.
                Support: False, str, unicode, dict, HTTPResponse, HTTPError, file-like,
                iterable of strings and iterable of unicodes
        Severity: Minor
        Found in lib/bottle.py - About 3 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 __match_signature_tree has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def __match_signature_tree(self, signature_tree, data, depth = 0):
                """Recursive function to find matches along the signature tree.
                
                signature_tree  is the part of the tree left to walk
                data    is the data being checked against the signature tree
        Severity: Minor
        Found in lib/pefile/peutils.py - About 3 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 parse_sections has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def parse_sections(self, offset):
                """Fetch the PE file sections.
                
                The sections will be readily available in the "sections" attribute.
                Its attributes will contain all the section information plus "data"
        Severity: Minor
        Found in lib/pefile/pefile.py - About 3 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

        Version_BlockType has 28 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Version_BlockType(GeneratedsSuper):
            subclass = None
            superclass = None
            def __init__(self, Internal_Name=None, Product_Name=None, Company_Name=None, Legal_Copyright=None, Product_Version_Text=None, File_Description=None, File_Version_Text=None, Original_File_Name=None):
                self.Internal_Name = Internal_Name
        Severity: Minor
        Found in lib/maec/maec11.py - About 3 hrs to fix

          Network_Action_AttributesType has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Network_Action_AttributesType(GeneratedsSuper):
              subclass = None
              superclass = None
              def __init__(self, Internal_Port=None, External_Port=None, Internal_IP_Address=None, External_IP_Address=None, Host_Name=None, Data_Sent=None, Data_Received=None, Buffer_Length=None):
                  self.Internal_Port = Internal_Port
          Severity: Minor
          Found in lib/maec/maec11.py - About 3 hrs to fix

            File_HeaderType has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class File_HeaderType(GeneratedsSuper):
                subclass = None
                superclass = None
                def __init__(self, Hashes=None, Machine=None, Number_Of_Sections=None, Time_Date_Stamp=None, Pointer_To_Symbol_Table=None, Number_Of_Symbols=None, Size_Of_Optional_Header=None, Characteristics=None):
                    self.Hashes = Hashes
            Severity: Minor
            Found in lib/maec/maec11.py - About 3 hrs to fix

              PESectionType has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class PESectionType(GeneratedsSuper):
                  """PESectionType is intended as container for the attributes relevant
                  to PE binary sections."""
                  subclass = None
                  superclass = None
              Severity: Minor
              Found in lib/maec/maec11.py - About 3 hrs to fix

                File database.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # Copyright (C) 2010-2012 Cuckoo Sandbox Developers.
                # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
                # See the file 'docs/LICENSE' for copying permission.
                
                import os
                Severity: Minor
                Found in lib/cuckoo/core/database.py - About 3 hrs to fix

                  GUI_Object_AttributesType has 26 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class GUI_Object_AttributesType(GeneratedsSuper):
                      subclass = None
                      superclass = None
                      def __init__(self, Width=None, Height=None, Window_Display_Name=None, Parent_Window=None, Owner_Window=None, Box_Text=None, Box_Caption=None):
                          self.Width = Width
                  Severity: Minor
                  Found in lib/maec/maec11.py - About 3 hrs to fix

                    PoolsType has 26 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class PoolsType(GeneratedsSuper):
                        subclass = None
                        superclass = None
                        def __init__(self, Behavior_Collection_Pool=None, Behavior_Pool=None, Action_Collection_Pool=None, Action_Pool=None, Object_Pool=None, Effect_Pool=None, Object_Collection_Pool=None):
                            self.Behavior_Collection_Pool = Behavior_Collection_Pool
                    Severity: Minor
                    Found in lib/maec/maec11.py - About 3 hrs to fix

                      Function _gen_files has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _gen_files(self):
                              """Gets files calls.
                              @return: information list.
                              """
                              files = []
                      Severity: Minor
                      Found in modules/processing/behavior.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 static_file has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def static_file(filename, root, mimetype='auto', download=False):
                          """ Open a file in a safe way and return :exc:`HTTPResponse` with status
                              code 200, 305, 401 or 404. Set Content-Type, Content-Encoding,
                              Content-Length and Last-Modified header. Obey If-Modified-Since header
                              and HEAD requests.
                      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 run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def run(self):
                              """Run analysis.
                              @return: operation status.
                              """
                              self.prepare()
                      Severity: Minor
                      Found in analyzer/windows/analyzer.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 _gen_mutexes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _gen_mutexes(self):
                              """Get mutexes information.
                              @return: Mutexes information list.
                              """
                              mutexes = []
                      Severity: Minor
                      Found in modules/processing/behavior.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 __setattr__ has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __setattr__(self, name, val):
                      
                              # If the instance doesn't yet have an ordinal attribute
                              # it's not fully initialized so can't do any of the
                              # following
                      Severity: Minor
                      Found in lib/pefile/pefile.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

                      File peutils.py has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: Latin-1 -*-
                      """peutils, Portable Executable utilities module
                      
                      
                      Copyright (c) 2005-2011 Ero Carrera <ero.carrera@gmail.com>
                      Severity: Minor
                      Found in lib/pefile/peutils.py - About 2 hrs to fix

                        classificationObject has 25 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class classificationObject(GeneratedsSuper):
                            """Classification object, used to hold names or classifications of
                            objects. The most common use case for this is detection names
                            for files from av scanners. However, this object could be used
                            for general classification. The globally unique id (attribute)
                        Severity: Minor
                        Found in lib/maec/maec11.py - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language