avocado-framework/avocado

View on GitHub

Showing 490 of 907 total issues

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

def get_file(
    src,
    dst,
    permissions=None,
    hash_expected=None,
Severity: Minor
Found in avocado/utils/download.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_methods_info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_methods_info(statement_body, class_tags, class_dependencies):
    """Returns information on test methods.

    :param statement_body: the body of a "class" statement
    :param class_tags: the tags at the class level, to be combined with the
Severity: Minor
Found in avocado/core/safeloader/core.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_tasks_from_test_task has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_tasks_from_test_task(
        cls,
        test_task,
        no_digits,
        base_dir,
Severity: Minor
Found in avocado/core/task/runtime.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

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

    def run(self):

        plugins_list = []
        directory = os.path.join(BASE_PATH, "optional_plugins")
        for plugin in list(Path(directory).glob("*/setup.py")):
Severity: Minor
Found in setup.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_dispatchers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_dispatchers(module_name):
    """Returns the classes that implement plugin dispatching

    These should inherit from the *ExtensionManager* base classes
    and contain suitable descriptions.
Severity: Minor
Found in avocado/core/dispatcher.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 run_and_check has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def run_and_check(self, testname, e_rc, e_ntests, e_nerrors, e_nfailures, e_nskip):
Severity: Major
Found in selftests/functional/basic.py - About 50 mins to fix

    Function wait_for has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def wait_for(func, timeout, first=0.0, step=1.0, text=None, args=None, kwargs=None):
    Severity: Major
    Found in avocado/utils/wait.py - About 50 mins to fix

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

          def __init__(
      Severity: Major
      Found in avocado/utils/asset.py - About 50 mins to fix

        Function check_file has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def check_file(
        Severity: Major
        Found in avocado/core/resolver.py - About 50 mins to fix

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

              def __init__(
          Severity: Major
          Found in avocado/core/task/runtime.py - About 50 mins to fix

            Function get_repo has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def get_repo(
            Severity: Major
            Found in avocado/utils/git.py - About 50 mins to fix

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

                  def get(
              Severity: Major
              Found in avocado/core/utils/messages.py - About 50 mins to fix

                Function iso has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def iso(
                Severity: Major
                Found in avocado/utils/cloudinit.py - About 50 mins to fix

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

                      def __init__(
                  Severity: Major
                  Found in avocado/utils/git.py - About 50 mins to fix

                    Function find_free_ports has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def find_free_ports(
                    Severity: Major
                    Found in avocado/utils/network/ports.py - About 50 mins to fix

                      Function add_log_handler has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def add_log_handler(
                      Severity: Major
                      Found in avocado/core/output.py - About 50 mins to fix

                        Function test_kill_process_tree_dont_timeout_3s has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def test_kill_process_tree_dont_timeout_3s(
                        Severity: Minor
                        Found in selftests/unit/utils/process.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if regexp.match(key):
                                                      remove.append(key)
                                              for key in remove:
                            Severity
                            Category
                            Status
                            Source
                            Language