avocado-framework/avocado

View on GitHub

Showing 895 of 913 total issues

Function run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):

        plugins_list = []
        directory = os.path.join(BASE_PATH, "optional_plugins")
        for plugin in list(Path(directory).glob("*/setup.py")):
Severity: Minor
Found in setup.py - About 55 mins 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_dispatchers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_dispatchers(module_name):
    """Returns the classes that implement plugin dispatching

    These should inherit from the *ExtensionManager* base classes
    and contain suitable descriptions.
Severity: Minor
Found in avocado/core/dispatcher.py - About 55 mins 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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if row_index is None:
            is_cell_chosen = False
            row_index = random.randint(0, len(matrix) - 1)
Severity: Minor
Found in optional_plugins/varianter_cit/avocado_varianter_cit/Cit.py and 1 other location - About 55 mins to fix
optional_plugins/varianter_cit/avocado_varianter_cit/Cit.py on lines 280..282

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    def test(self):
        self.log.info("test pre")
        time.sleep(10)
        self.log.info("test post")
Severity: Major
Found in selftests/.data/test_statuses.py and 2 other locations - About 55 mins to fix
selftests/.data/test_statuses.py on lines 200..204
selftests/.data/test_statuses.py on lines 221..225

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    def setUp(self):
        self.log.info("setup pre")
        sys.exit(-1)
        # pylint: disable=W0101
        self.log.info("setup post")
Severity: Major
Found in selftests/.data/test_statuses.py and 2 other locations - About 55 mins to fix
selftests/.data/test_statuses.py on lines 221..225
selftests/.data/test_statuses.py on lines 308..311

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if column_index is None:
            is_cell_chosen = False
            column_index = random.randint(0, len(row) - 1)
Severity: Minor
Found in optional_plugins/varianter_cit/avocado_varianter_cit/Cit.py and 1 other location - About 55 mins to fix
optional_plugins/varianter_cit/avocado_varianter_cit/Cit.py on lines 276..278

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    def test(self):
        self.log.info("test pre")
        sys.exit(-1)
        # pylint: disable=W0101
        self.log.info("test post")
Severity: Major
Found in selftests/.data/test_statuses.py and 2 other locations - About 55 mins to fix
selftests/.data/test_statuses.py on lines 200..204
selftests/.data/test_statuses.py on lines 308..311

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def setUp(self):
        self.suite = None
        prefix = temp_dir_prefix(self)
        self.tmpdir = tempfile.TemporaryDirectory(prefix=prefix)
Severity: Minor
Found in selftests/unit/suite.py and 1 other location - About 55 mins to fix
selftests/unit/job.py on lines 17..20

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def setUp(self):
        self.job = None
        prefix = temp_dir_prefix(self)
        self.tmpdir = tempfile.TemporaryDirectory(prefix=prefix)
Severity: Minor
Found in selftests/unit/job.py and 1 other location - About 55 mins to fix
selftests/unit/suite.py on lines 12..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function run_and_check has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def run_and_check(self, testname, e_rc, e_ntests, e_nerrors, e_nfailures, e_nskip):
Severity: Major
Found in selftests/functional/basic.py - About 50 mins to fix

    Function wait_for has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def wait_for(func, timeout, first=0.0, step=1.0, text=None, args=None, kwargs=None):
    Severity: Major
    Found in avocado/utils/wait.py - About 50 mins to fix

      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Major
      Found in avocado/utils/asset.py - About 50 mins to fix

        Function find_free_ports has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def find_free_ports(
        Severity: Major
        Found in avocado/utils/network/ports.py - About 50 mins to fix

          Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(
          Severity: Major
          Found in avocado/utils/git.py - About 50 mins to fix

            Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in avocado/core/task/runtime.py - About 50 mins to fix

              Function iso has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def iso(
              Severity: Major
              Found in avocado/utils/cloudinit.py - About 50 mins to fix

                Function get_repo has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def get_repo(
                Severity: Major
                Found in avocado/utils/git.py - About 50 mins to fix

                  Function get has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def get(
                  Severity: Major
                  Found in avocado/core/utils/messages.py - About 50 mins to fix

                    Function check_file has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def check_file(
                    Severity: Major
                    Found in avocado/core/resolver.py - About 50 mins to fix

                      Function add_log_handler has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def add_log_handler(
                      Severity: Major
                      Found in avocado/core/output.py - About 50 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language