avocado-framework/avocado

View on GitHub

Showing 490 of 907 total issues

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

    def cover_missing_combination(self, matrix):
        """
        Randomly finds one missing combination. This combination puts into each
        row of the matrix. The row with the best coverage is the solution

Severity: Minor
Found in optional_plugins/varianter_cit/avocado_varianter_cit/Cit.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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def render(self, result, job):
        if job.status in ("RUNNING", "ERROR", "FAIL"):
            return  # Don't create results on unfinished or errored jobs
        if not (
            job.config.get("job.run.result.html.enabled")
Severity: Minor
Found in optional_plugins/html/avocado_result_html/__init__.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 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 lv_create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def lv_create(
    vg_name, lv_name, lv_size, force_flag=True, pool_name=None, pool_size="1G"
):
    """
    Create a (possibly thin) logical volume in a volume group.
Severity: Minor
Found in avocado/utils/lv_utils.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 graft has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def graft(self, dict_):
        for name, value in list(dict_.items()):
            name = name.replace("-", "_")
            if isinstance(value, dict):
                value = GdbDynamicObject(value)
Severity: Minor
Found in avocado/utils/external/gdbmi_parser.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 system has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

        def _get_relative_dir(self):
            """
            When an asset name is not an URI, and:
              1. it also has a hash;
              2. or it has multiple locations;
    Severity: Minor
    Found in avocado/utils/asset.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 run has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

      def get_path_status(disk_path):
          """
          Return the status of a path in multipath.
      
          :param disk_path: disk path. Example: sda, sdb.
      Severity: Minor
      Found in avocado/utils/multipath.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 create_job_logs_dir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def create_job_logs_dir(base_dir=None, unique_id=None):
          """
          Create a log directory for a job, or a stand alone execution of a test.
      
          :param base_dir: Base log directory, if `None`, use value from configuration.
      Severity: Minor
      Found in avocado/core/data_dir.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 map_method has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def map_method(self, method_name, *args):
              """
              Maps method_name on each extension in case the extension has the attr
      
              :param method_name: Name of the method to be called on each ext
      Severity: Minor
      Found in avocado/core/extension_manager.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 validate_ipv4_netmask_format has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def validate_ipv4_netmask_format(self, netmask):
              """
              This function validates IPv4 Netmask address with following format set.
      
              1. A string in decimal-dot notation,consisting of four decimal integers
      Severity: Minor
      Found in avocado/utils/network/interfaces.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 to_str has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_str(self, summary=0, variants=0, **kwargs):  # pylint: disable=W0613
              if not self.variants:
                  return ""
              out = []
              for variant in self.variants:
      Severity: Minor
      Found in avocado/core/varianter.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 initialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def initialize(self):
              help_msg = (
                  "Enable or disable sysinfo collection (like hardware "
                  "details, profiles, etc.)"
              )
      Severity: Minor
      Found in avocado/plugins/sysinfo.py - About 1 hr to fix

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

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

          Function getoutput has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

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

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

              Function getstatusoutput has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

                Function _examine_same_module has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

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

                      def __init__(
                  Severity: Major
                  Found in avocado/utils/vmimage.py - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language