avocado-framework/avocado

View on GitHub

Showing 885 of 903 total issues

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

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

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

                  Function end_test has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def end_test(self, result, state):
                          """
                          Create the ResultsDB result, which corresponds to one test from
                          the Avocado Job
                          """
                  Severity: Minor
                  Found in optional_plugins/resultsdb/avocado_resultsdb/resultsdb.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 _node_content_from_node has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _node_content_from_node(path, node, values, using):
                      """Processes node values into the current node content"""
                      for value in values:
                          if isinstance(value, mux.MuxTreeNode):
                              node.add_child(value)

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

                  def python_resolver(name, reference, find_tests):
                      module_path, tests_filter = reference_split(reference)
                      if tests_filter is not None:
                          tests_filter = re.compile(tests_filter)
                  
                  
                  Severity: Minor
                  Found in avocado/plugins/resolvers.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 test_all_commands has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def test_all_commands(self):
                          command_name = "service"
                          # Test all commands except "set_target" which is tested elsewhere
                          for cmd, _ in (
                              (c, r)
                  Severity: Minor
                  Found in selftests/unit/utils/service.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_namespace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create_namespace(
                          self,
                          region="",
                          bus="",
                          n_type="pmem",
                  Severity: Minor
                  Found in avocado/utils/pmem.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_suite has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def run_suite(self, job, test_suite):
                          summary = set()
                  
                          if not test_suite.enabled:
                              job.interrupted_reason = f"Suite {test_suite.name} is disabled."
                  Severity: Minor
                  Found in avocado/plugins/runner_nrunner.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 vg_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def vg_list(vg_name=None):
                      """
                      List all info about available volume groups.
                  
                      :param vg_name: name of the volume group to list or or None to list all
                  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 get_source has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_source(self, name, dest_path, build_option=None):
                          """
                          Downloads the source package and prepares it in the given dest_path
                          to be ready to build.
                  
                  
                  Severity: Minor
                  Found in avocado/utils/software_manager/backends/yum.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 vg_ramdisk has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def vg_ramdisk(
                      disk,
                      vg_name,
                      ramdisk_vg_size,
                      ramdisk_basedir,
                  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 check_installed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def check_installed(self, name, version=None, arch=None):
                          """
                          Check if package [name] is installed.
                  
                          :param name: Package name.
                  Severity: Minor
                  Found in avocado/utils/software_manager/backends/rpm.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 iso has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def iso(
                      output_path,
                      instance_id,
                      username=None,
                      password=None,
                  Severity: Minor
                  Found in avocado/utils/cloudinit.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_buddy_info has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def get_buddy_info(chunk_sizes, nodes="all", zones="all"):
                      """
                      Get the fragment status of the host.
                  
                      It uses the same method to get the page size in buddyinfo. The expression
                  Severity: Minor
                  Found in avocado/utils/memory.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