hackedteam/test-av

View on GitHub

Showing 1,005 of 1,471 total issues

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

    def parse_delay_import_directory(self, rva, size):
        """Walk and parse the delay import directory."""
        
        import_descs =  []
        while True:
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 buildAttributes has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('successful', node)
        if value is not None and 'successful' not in already_processed:
            already_processed.append('successful')
            if value in ('true', '1'):
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 14 (exceeds 5 allowed). Consider refactoring.
Open

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Header_Hashes':
            obj_ = Header_HashesType.factory()
            obj_.build(child_)
            self.set_Header_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 buildChildren has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'DateTime_Created':
            DateTime_Created_ = child_.text
            DateTime_Created_ = self.gds_validate_string(DateTime_Created_, node, 'DateTime_Created')
            self.DateTime_Created = DateTime_Created_
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 14 (exceeds 5 allowed). Consider refactoring.
Open

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Internal_Port':
            sval_ = child_.text
            try:
                ival_ = int(sval_)
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 14 (exceeds 5 allowed). Consider refactoring.
Open

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Internal_Port':
            sval_ = child_.text
            try:
                ival_ = int(sval_)
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 dump_info has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def dump_info(self, dump=None):
        """Dump all the PE header information into human readable string."""
        
        
        if dump is None:
Severity: Minor
Found in lib/pefile/pefile.py - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (
                self.references is not None or
                self.startDate is not None or
                self.endDate is not None or
                self.firstSeenDate is not None or
    Severity: Critical
    Found in lib/maec/maec11.py - About 1 hr to fix

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

          def __init__(self, successful=None, timestamp=None, action_name=None, ordinal_position=None, type_=None, id=None, Description=None, Discovery_Method=None, Action_Initiator=None, Action_Implementation=None, Objects=None, Effects=None, Related_Actions=None):
      Severity: Major
      Found in lib/maec/maec11.py - About 1 hr to fix

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

            def run(self, results):
                """Writes report.
                @param results: Cuckoo results dict.
                @raise CuckooReportError: if fails to write report.
                """
        Severity: Minor
        Found in modules/reporting/reporthtml.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 addActions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def addActions(self):
                """Adds actions section."""
                # Processes
                for process in self.results['behavior']['processes']:
                    self.createActionAPI(process)
        Severity: Minor
        Found in modules/reporting/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 __match has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def __match(self, pe, ep_only, section_start_only):
                
                # Load the corresponding set of signatures
                # Either the one for ep_only equal to True or
                # to False
        Severity: Minor
        Found in lib/pefile/peutils.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 lookup has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def lookup(self, name):
                ''' Search for a resource and return an absolute file path, or `None`.
        
                    The :attr:`path` list is searched in order. The first match is
                    returend. Symlinks are followed. The result is cached to speed up
        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 dump_memory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def dump_memory(self):
                """Dump process memory.
                @return: operation status.
                """
                if self.pid == 0:
        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_root has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def _get_root(self, root="", container="cuckoo", create=True):
                """Get Cuckoo path.
                @param root: force root folder, don't detect it.
                @param container: folder which will contain Cuckoo, not used root parameter is used.
                @param create: create folder.
        Severity: Minor
        Found in agent/agent.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 __setattr__ has a Cognitive Complexity of 13 (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 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_class_obj_ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

                def get_class_obj_(self, node, default_class=None):
                    class_obj1 = default_class
                    if 'xsi' in node.nsmap:
                        classname = node.get('{%s}type' % node.nsmap['xsi'])
                        if classname is not None:
        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 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
                if nodeName_ == 'references':
                    obj_ = referencesType.factory()
                    obj_.build(child_)
                    self.set_references(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 __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, start_datetime=None, lastupdate_datetime=None, id=None, complete_datetime=None, analysis_method=None, Subject=None, Description=None, Analysts=None, Source=None, Analysis_Environment=None, Tools_Used=None, Notes=None):
        Severity: Major
        Found in lib/maec/maec11.py - About 1 hr to fix

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

              def __init__(self, DateTime_Created=None, DateTime_Modified=None, Path=None, Hashes=None, Permissions=None, File_Type=None, Packing=None, Pipe_Mode=None, Maximum_Instances=None, Security_Attributes=None, Origin=None, File_Type_Attributes=None):
          Severity: Major
          Found in lib/maec/maec11.py - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language