avocado-framework/avocado

View on GitHub

Showing 488 of 901 total issues

File iso9660.py has 394 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
Severity: Minor
Found in avocado/utils/iso9660.py - About 5 hrs to fix

    Function _examine_class has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

    def _examine_class(
        target_module, target_class, determine_match, path, class_name, match
    ):
        """
        Examine a class from a given path
    Severity: Minor
    Found in avocado/core/safeloader/core.py - About 5 hrs 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

    File distro.py has 389 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    #
    Severity: Minor
    Found in avocado/utils/distro.py - About 5 hrs to fix

      Function merge has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def merge(self, other):
              """
              Merges `other` node into this one without checking the name of the
              other node. New values are appended, existing values overwritten
              and unaffected ones are kept. Then all other node children are

      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

      File diff.py has 377 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # This program is free software; you can redistribute it and/or modify
      # it under the terms of the GNU General Public License as published by
      # the Free Software Foundation; either version 2 of the License, or
      # (at your option) any later version.
      #
      Severity: Minor
      Found in avocado/plugins/diff.py - About 5 hrs to fix

        File output_check.py has 374 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import json
        import os
        import unittest
        
        from avocado.core import exit_codes
        Severity: Minor
        Found in selftests/functional/output_check.py - About 5 hrs to fix

          File core.py has 368 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import ast
          import collections
          import sys
          from importlib.machinery import PathFinder
          
          
          Severity: Minor
          Found in avocado/core/safeloader/core.py - About 4 hrs to fix

            Function factory has 120 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var factory = function( $, DataTable ) {
                "use strict";
            
            
                /* Set the defaults for DataTables initialisation */

              Function reconfigure has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

              def reconfigure(args):
                  """
                  Adjust logging handlers accordingly to app args and re-log messages.
                  """
              
              
              Severity: Minor
              Found in avocado/core/output.py - About 4 hrs 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

              File memory.py has 364 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # This program is free software; you can redistribute it and/or modify
              # it under the terms of the GNU General Public License as published by
              # the Free Software Foundation; either version 2 of the License, or
              # (at your option) any later version.
              #
              Severity: Minor
              Found in avocado/utils/memory.py - About 4 hrs to fix

                ArchiveTest has 36 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class ArchiveTest(unittest.TestCase):
                    def setUp(self):
                        prefix = temp_dir_prefix(self)
                        self.basedir = tempfile.TemporaryDirectory(prefix=prefix)
                        self.compressdir = tempfile.mkdtemp(dir=self.basedir.name)
                Severity: Minor
                Found in selftests/unit/utils/archive.py - About 4 hrs to fix

                  Function makeState has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def makeState(self, state, sym):
                          assert sym is not None
                          #
                          #  Compute \epsilon-kernel state's core and see if
                          #  it exists already.
                  Severity: Minor
                  Found in avocado/utils/external/spark.py - About 4 hrs 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

                  File plugin_interfaces.py has 357 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # This program is free software; you can redistribute it and/or modify
                  # it under the terms of the GNU General Public License as published by
                  # the Free Software Foundation; either version 2 of the License, or
                  # (at your option) any later version.
                  #
                  Severity: Minor
                  Found in avocado/core/plugin_interfaces.py - About 4 hrs to fix

                    File job.py has 356 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import logging
                    import os
                    import tempfile
                    import unittest.mock
                    
                    
                    Severity: Minor
                    Found in selftests/unit/job.py - About 4 hrs to fix

                      TapParserTests has 35 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class TapParserTests(unittest.TestCase):
                          def assert_test(self, events, **kwargs):
                              if "explanation" not in kwargs:
                                  kwargs["explanation"] = None
                              self.assertEqual(next(events), TapParser.Test(**kwargs))
                      Severity: Minor
                      Found in selftests/unit/tap.py - About 4 hrs to fix

                        File multipath.py has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # This program is free software; you can redistribute it and/or modify
                        # it under the terms of the GNU General Public License as published by
                        # the Free Software Foundation; either version 2 of the License, or
                        # (at your option) any later version.
                        #
                        Severity: Minor
                        Found in avocado/utils/multipath.py - About 4 hrs to fix

                          Function simplify_constraints has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def simplify_constraints(self):
                                  items_to_remove = set()
                                  copy = list(self.constraints.copy())
                                  for i in range(len(copy)):
                                      is_brake = False
                          Severity: Minor
                          Found in optional_plugins/varianter_cit/avocado_varianter_cit/Solver.py - About 4 hrs 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 clean_hash_table has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def clean_hash_table(self, combination_matrix, t_value):
                                  for constraint in self.constraints:
                                      if len(constraint) > t_value:
                                          continue
                                      parameters_in_constraint = []
                          Severity: Minor
                          Found in optional_plugins/varianter_cit/avocado_varianter_cit/Solver.py - About 4 hrs 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 makeSet has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def makeSet(self, token, sets, i):
                                  cur, next_item = sets[i], sets[i + 1]
                          
                                  ttype = (  # pylint: disable=R1709
                                      token is not None and self.typestring(token) or None
                          Severity: Minor
                          Found in avocado/utils/external/spark.py - About 4 hrs 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 compare_matrices has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def compare_matrices(matrix1, matrix2, threshold=0.05):
                              """
                              Compare 2 matrices nxm and return a matrix nxm with comparison data and
                              stats. When the first columns match, they are considered as header and
                              included in the results intact.
                          Severity: Minor
                          Found in avocado/utils/data_structures.py - About 4 hrs 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