avocado-framework/avocado

View on GitHub

Showing 490 of 907 total issues

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

def analyze_unpickable_item(path_prefix, obj):
    """
    Recursive method to obtain unpickable objects along with location

    :param path_prefix: Path to this object
Severity: Minor
Found in avocado/utils/stacktrace.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 strip_console_codes has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def strip_console_codes(output, custom_codes=None):
    """
    Remove the Linux console escape and control sequences from the console
    output. Make the output readable and can be used for result check. Now
    only remove some basic console codes using during boot up.
Severity: Minor
Found in avocado/utils/astring.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 mkfs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def mkfs(self, fstype=None, args=""):
        """
        Format a partition to filesystem type

        :param fstype: the filesystem type, such as "ext3", "ext2". Defaults
Severity: Minor
Found in avocado/utils/partition.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 mount has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def mount(self, mountpoint=None, fstype=None, args="", mnt_check=True):
        """
        Mount this partition to a mount point

        :param mountpoint: If you have not provided a mountpoint to partition
Severity: Minor
Found in avocado/utils/partition.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 add_argparser_to_option has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

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

          def handle_default():
              LOG_UI.info(
                  "Config files read (in order, '*' means the file exists "
                  "and had been read):"
              )
      Severity: Minor
      Found in avocado/plugins/config.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 _handle_control_tag has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def _handle_control_tag(path, node, value):
          """
          Handling of most YAML control tags (all but "!using")
      
          :param path: path on the YAML

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

          def compute(self):
              """
              Searching for the best solution. It creates one solution and from that,
              it tries to create smaller solution. This searching process is limited
              by ITERATIONS_SIZE. When ITERATIONS_SIZE is 0 the last found solution is
      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 _display_extra has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _display_extra(suite, verbose=True):
              """Display extra data when in verbose mode."""
              if not verbose:
                  return
      
      
      Severity: Minor
      Found in avocado/plugins/list.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_version_match has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _get_version_match(self):
              """
              Returns the match result for the version regex on the file content
              """
              if self.check_version():
      Severity: Minor
      Found in avocado/utils/distro.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_package_management has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_package_management(self):
              """
              Determine the supported package management systems present on the
              system. If more than one package management system installed, try
              to find the best supported system.
      Severity: Minor
      Found in avocado/utils/software_manager/inspector.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 parse_test has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def parse_test(self, ok, num, name, directive, explanation):
              name = name.strip()
              explanation = explanation.strip() if explanation else None
              if directive is not None:
                  directive = directive.upper()
      Severity: Minor
      Found in avocado/core/tapparser.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_attributes_for_further_examination has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def _get_attributes_for_further_examination(parent, module):
          """Returns path, module and class for further examination.
      
          This looks at one of the parents of an interesting class, so for the
          example class Test below:
      Severity: Minor
      Found in avocado/core/safeloader/core.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 deco_factory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def deco_factory(behavior, signal):
          """
          Decorator factory.
      
          Returns a decorator used to signal the test when specified exception is
      Severity: Minor
      Found in avocado/core/decorators.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 lscpu has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def lscpu():
          """
          Get Cores per socket, Physical sockets and Physical chips
          by executing 'lscpu' command.
      
      
      Severity: Minor
      Found in avocado/utils/cpu.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 is_matching_klass has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def is_matching_klass(self, klass):
              """
              Detect whether given class directly defines itself as <module>.<klass>
      
              It can either be a <klass> that inherits from a test "symbol", like:
      Severity: Minor
      Found in avocado/core/safeloader/module.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_mpath_paths_status has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_mpath_paths_status(wwid):
          """
          Return the status of all paths of mpath device.
      
          :param wwid: wwid or user friendly name of mpath.
      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 variant_to_str has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def variant_to_str(variant, verbosity, out_args=None, debug=False):
          """
          Reports human readable representation of a variant
      
          :param variant: Valid variant (list of TreeNode-like objects)
      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 run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(self):
              super().run()
              cleaning_list = [
                  "PYPI_UPLOAD",
                  "EGG_UPLOAD",
      Severity: Minor
      Found in setup.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

      Severity
      Category
      Status
      Source
      Language