avocado-framework/avocado

View on GitHub

Showing 490 of 907 total issues

File basic.py has 1339 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import glob
import json
import os
import re
import tempfile
Severity: Major
Found in selftests/functional/basic.py - About 3 days to fix

    File process.py has 1120 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: Major
    Found in avocado/utils/process.py - About 2 days to fix

      File test.py has 722 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; specifically version 2 of the License.
      #
      # This program is distributed in the hope that it will be useful,
      Severity: Major
      Found in avocado/core/test.py - About 1 day to fix

        File interfaces.py has 707 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: Major
        Found in avocado/utils/network/interfaces.py - About 1 day to fix

          File check.py has 705 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #!/usr/bin/env python3
          
          import argparse
          import copy
          import glob
          Severity: Major
          Found in selftests/check.py - About 1 day to fix

            Function _parse has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
            Open

                def _parse(self, indent_size=0, version=12):
                    found_late_test = False
                    bailed_out = False
                    plan = None
                    num_tests = 0
            Severity: Minor
            Found in avocado/core/tapparser.py - About 1 day 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 process.py has 691 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import io
            import logging
            import os
            import sys
            import time
            Severity: Major
            Found in selftests/unit/utils/process.py - About 1 day to fix

              File settings.py has 651 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; specifically version 2 of the License.
              #
              # This program is distributed in the hope that it will be useful,
              Severity: Major
              Found in avocado/core/settings.py - About 1 day to fix

                File gdb.py has 636 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: Major
                Found in avocado/utils/gdb.py - About 1 day to fix

                  File service.py has 620 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  #  Copyright(c) 2013 Intel Corporation.
                  #
                  #  This program is free software; you can redistribute it and/or modify it
                  #  under the terms and conditions of the GNU General Public License,
                  #  version 2, as published by the Free Software Foundation.
                  Severity: Major
                  Found in avocado/utils/service.py - About 1 day to fix

                    File output.py has 609 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: Major
                    Found in avocado/core/output.py - About 1 day to fix

                      File job.py has 592 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: Major
                      Found in avocado/core/job.py - About 1 day to fix

                        File output.py has 582 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import json
                        import os
                        import re
                        import shlex
                        import unittest
                        Severity: Major
                        Found in selftests/functional/output.py - About 1 day to fix

                          File lv_utils.py has 581 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # Copyright (C) IBM 2016 - Harish <harisrir@linux.vnet.ibm.com>
                          # Copyright (C) Red Hat 2016 - Lukas Doktor <ldoktor@redhat.com>
                          # Copyright (C) Intra2net AG 2018 - Plamen Dimitrov <pdimitrov@pevogam.com>
                          #
                          # This program is free software; you can redistribute it and/or modify it
                          Severity: Major
                          Found in avocado/utils/lv_utils.py - About 1 day to fix

                            File spark.py has 580 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            #  Copyright (c) 1998-2002 John Aycock
                            #
                            #  Permission is hereby granted, free of charge, to any person obtaining
                            #  a copy of this software and associated documentation files (the
                            #  "Software"), to deal in the Software without restriction, including
                            Severity: Major
                            Found in avocado/utils/external/spark.py - About 1 day to fix

                              File vmimage.py has 577 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: Major
                              Found in avocado/utils/vmimage.py - About 1 day to fix

                                Function makeSet_fast has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def makeSet_fast(self, token, sets, i):
                                        #
                                        #  Call *only* when the entire state machine has been built!
                                        #  It relies on self.edges being filled in completely, and
                                        #  then duplicates and inlines code to boost speed at the
                                Severity: Minor
                                Found in avocado/utils/external/spark.py - About 1 day 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 list_downloaded_images has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def list_downloaded_images():
                                    """
                                    List the available Image inside avocado cache
                                    :return: list with image's parameters
                                    :rtype: list of dicts
                                Severity: Minor
                                Found in avocado/plugins/vmimage.py - About 1 day 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 asset.py has 558 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: Major
                                Found in avocado/utils/asset.py - About 1 day to fix

                                  File cpu.py has 551 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: Major
                                  Found in avocado/utils/cpu.py - About 1 day to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language