avocado-framework/avocado

View on GitHub

Showing 494 of 703 total issues

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

    def __init__(
Severity: Major
Found in avocado/utils/process.py - About 1 hr to fix

    Function get has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def get(
    Severity: Major
    Found in avocado/utils/vmimage.py - About 1 hr to fix

      Function get_tasks_from_test_task has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def get_tasks_from_test_task(
      Severity: Major
      Found in avocado/core/task/runtime.py - About 1 hr to fix

        Function from_runnable has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def from_runnable(
        Severity: Major
        Found in avocado/core/task/runtime.py - About 1 hr to fix

          Function fetch_asset has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def fetch_asset(
          Severity: Major
          Found in avocado/core/test.py - About 1 hr to fix

            Function test_job_run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def test_job_run(self):
                    class JobFilterLog(job.Job):
                        def pre_tests(self):
                            for suite in self.test_suites:
                                filtered_test_suite = []
            Severity: Minor
            Found in selftests/unit/job.py - About 55 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 _install has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _install(software_manager, cmd, package):
                    result = "pass"
                    stderr = ""
                    if not software_manager.check_installed(package):
                        if software_manager.install(package):
            Severity: Minor
            Found in avocado/plugins/runners/package.py - About 55 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 _remove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _remove(software_manager, cmd, package):
                    result = "pass"
                    stderr = ""
                    if software_manager.check_installed(package):
                        if software_manager.remove(package):
            Severity: Minor
            Found in avocado/plugins/runners/package.py - About 55 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 merge_results has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def merge_results(results, result_json_paths):
                for result_json_path in result_json_paths:
                    job = get_one_job_results(result_json_path, results)
                    for test_id_key, test_id_value in job.items():
                        if test_id_key not in results:
            Severity: Minor
            Found in contrib/scripts/summarize-job-failures.py - About 55 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 reserve_slot has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def reserve_slot(self, runtime_task):
                    """
                    Reserve a free or custom container slot for the runtime task.
            
                    :param runtime_task: runtime task to reserve the slot for
            Severity: Minor
            Found in avocado/plugins/spawners/lxc.py - About 55 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 _apply_using has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def _apply_using(name, using, node):
                """
                Create the structure defined by "!using" and return the new root
            
                :param name: the tag name to have the "!using" applied to

            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 connect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def connect(self):
                    """
                    Establishes the connection to the remote endpoint
            
                    On this implementation, it means creating the master connection,
            Severity: Minor
            Found in avocado/utils/ssh.py - About 55 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 parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def parse(self, tokens):
                    sets = [[(1, 0), (2, 0)]]
                    self.links = {}  # pylint: disable=W0201
            
                    if self.ruleschanged:
            Severity: Minor
            Found in avocado/utils/external/spark.py - About 55 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 addRule has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def addRule(self, doc, func, _preprocess=1):
                    fn = func
                    rules = doc.split()
            
                    index = []
            Severity: Minor
            Found in avocado/utils/external/spark.py - About 55 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_infoblock has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def read_infoblock(self, namespace="", inp_file="", **kwargs):
                    """
                    Read an infoblock from the specified medium
            
                    :param namespace: Read the infoblock from given namespace
            Severity: Minor
            Found in avocado/utils/pmem.py - About 55 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 check_kernel_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def check_kernel_config(config_name):
                """
                Reports the configuration of $config_name of the current kernel
            
                :param config_name: Name of kernel config to search
            Severity: Minor
            Found in avocado/utils/linux_modules.py - About 55 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 _render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _render(self, result, max_test_log_size, job_name):
                    document = Document()
                    testsuite = document.createElement("testsuite")
                    if job_name:
                        testsuite.setAttribute("name", job_name)
            Severity: Minor
            Found in avocado/plugins/xunit.py - About 55 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 get_node has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_node(self, path, create=False):
                    """
                    :param path: Path of the desired node (relative to this node)
                    :param create: Create the node (and intermediary ones) when not present
                    :return: the node associated with this path
            Severity: Minor
            Found in avocado/core/tree.py - About 55 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 iteritems has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def iteritems(self):
                    """
                    Iterate through all available params and yield origin, key and value
                    of each unique value.
                    """
            Severity: Minor
            Found in avocado/core/parameters.py - About 55 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 collect_errors_by_level has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def collect_errors_by_level(output_file=None, level_check=5, skip_errors=None):
                """Verify dmesg having severity level of OS issue(s).
            
                :param output_file: The file used to save dmesg
                :type output_file: str
            Severity: Minor
            Found in avocado/utils/dmesg.py - About 55 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

            Severity
            Category
            Status
            Source
            Language