avocado-framework/avocado

View on GitHub

Showing 490 of 907 total issues

Function add_argparser has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

    Function initialize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def initialize(self, config):
            self.variants = None  # pylint: disable=W0201
            error = False
    
            subcommand = config.get("subcommand", "run")

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

        def end_test(self, result, state):
            """
            Log the test status and details
            """
            if not self.is_header_printed:
    Severity: Minor
    Found in avocado/plugins/tap.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 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_source(self, name, path):
            """
            Download source for provided package. Returns the path with source placed.
    
            :param name: parameter wildcard package to get the source for
    Severity: Minor
    Found in avocado/utils/software_manager/backends/apt.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 buildTree has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def buildTree(self, nt, item, tokens, k):
            state, _ = item
    
            choices = []
            for rule in self.states[state].complete:
    Severity: Minor
    Found in avocado/utils/external/spark.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 __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, record):
            self.result = None
            for name, value in list(record[0].items()):
                name = name.replace("-", "_")
                if name == "results":
    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 __getstate__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def __getstate__(self):
            if self.ruleschanged:
                #
                #  FIX ME - duplicated from parse()
                #
    Severity: Minor
    Found in avocado/utils/external/spark.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_repo has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_repo(self, url, **opt_params):
            """
            Adds package repository located on [url].
    
            :param url: Universal Resource Locator of the repository.
    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 write_infoblock has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def write_infoblock(self, namespace="", stdout=False, output=None, **kwargs):
            """
            Write an infoblock to the specified medium.
    
            :param namespace: Write the infoblock to given namespace
    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 get_x86_amd_zen has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_x86_amd_zen(family=None, model=None):
        """
        :param family: AMD family
        :type family: int
        :param model: AMD model
    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 _get_collectibles has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def _get_collectibles(self, c_profiler):
            self.sysinfo_files = gather_collectibles_config(self.config)
    
            profiler = c_profiler
            if profiler is None:
    Severity: Minor
    Found in avocado/core/sysinfo.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 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(self):
            self.setup_output_dir()
            runner_klass = self.runnable.pick_runner_class()
            runner = runner_klass()
            running_status_services = self.status_services
    Severity: Minor
    Found in avocado/core/nrunner/task.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 __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            methodName="test",
            name=None,
            params=None,
    Severity: Minor
    Found in avocado/core/test.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_command_args has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_command_args(self):
            """
            Returns the command arguments that adhere to the runner interface
    
            This is useful for building 'runnable-run' and 'task-run' commands
    Severity: Minor
    Found in avocado/core/nrunner/runnable.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 generate_variant_id has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def generate_variant_id(variant):
        """
        Basic function to generate variant-id from a variant
    
        :param variant: Avocado test 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 system_output has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Function configure has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def configure(self, parser):
              """
              Add the subparser for the run action.
      
              :param parser: Main test runner parser.
      Severity: Minor
      Found in avocado/plugins/run.py - About 1 hr to fix

        Function test_get_job_results_dir has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def test_get_job_results_dir(self):
                from avocado.core import data_dir, job_id
        
                # First let's mock a jobs results directory
                #
        Severity: Minor
        Found in selftests/unit/datadir.py - About 1 hr to fix

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

          def _node_content_from_dict(path, node, values, using):
              """Processes dict values into the current node content"""
              for key, value in values.items():
                  if isinstance(key, mux.Control):
                      if key.code == YAML_USING:

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

          def _create_from_yaml(path):
              """Create tree structure from yaml stream"""
          
              # Parse file name ([$using:]$path)
              path = __RE_FILE_SPLIT.split(path, 1)

          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