avocado-framework/avocado

View on GitHub
avocado/utils/gdb.py

Summary

Maintainability
D
1 day
Test Coverage
F
30%

subprocess call - check for execution of untrusted input.
Open

            self.process = subprocess.Popen(
                args,
                stdin=subprocess.PIPE,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
Severity: Info
Found in avocado/utils/gdb.py by bandit

subprocess call - check for execution of untrusted input.
Open

            self.process = subprocess.Popen(
                args,
                stdin=subprocess.PIPE,
                stdout=self.stdout,
                stderr=self.stderr,
Severity: Info
Found in avocado/utils/gdb.py by bandit

Consider possible security implications associated with subprocess module.
Open

import subprocess
Severity: Info
Found in avocado/utils/gdb.py by bandit

File gdb.py has 636 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
Severity: Major
Found in avocado/utils/gdb.py - About 1 day to fix

    Function cmd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def cmd(self, command):
            """
            Sends a command and parses all lines until prompt is received
    
            :param command: the GDB command, hopefully in MI language
    Severity: Minor
    Found in avocado/utils/gdb.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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            path=None,
            port=None,
            wait_until_running=True,
    Severity: Minor
    Found in avocado/utils/gdb.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 read_gdb_response has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def read_gdb_response(self, timeout=0.01, max_tries=100):
            """
            Read raw responses from GDB
    
            :param timeout: the amount of time to way between read attempts
    Severity: Minor
    Found in avocado/utils/gdb.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 cmd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def cmd(self, command_data, expected_response=None):
            """
            Sends a command data to a remote gdb server
    
            Limitations: the current version does not deal with retransmissions.
    Severity: Minor
    Found in avocado/utils/gdb.py - About 35 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 exit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def exit(self, force=True):
            """
            Quits the gdb_server process
    
            Most correct way of quitting the GDB server is by sending it a command.
    Severity: Minor
    Found in avocado/utils/gdb.py - About 25 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

    There are no issues that match your filters.

    Category
    Status