avocado-framework/avocado

View on GitHub
avocado/core/runner.py

Summary

Maintainability
C
1 day
Test Coverage
C
74%

Function finish has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def finish(self, proc, started, step, deadline, result_dispatcher):
        """
        Wait for the test process to finish and report status or error status
        if unable to obtain the status till deadline.

Severity: Minor
Found in avocado/core/runner.py - About 3 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 early_status has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def early_status(self):
        """
        Get early status
        """
        if self._early_status:
Severity: Minor
Found in avocado/core/runner.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 wait_for_early_status has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def wait_for_early_status(self, proc, timeout):
        """
        Wait until early_status is obtained
        :param proc: test process
        :param timeout: timeout for early_state
Severity: Minor
Found in avocado/core/runner.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 _tick has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def _tick(self):
        """
        Process the queue and update current status
        """
        while not self.queue.empty():
Severity: Minor
Found in avocado/core/runner.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 finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def finish(self, proc, started, step, deadline, result_dispatcher):
Severity: Minor
Found in avocado/core/runner.py - About 35 mins to fix

    Function add_runner_failure has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def add_runner_failure(test_state, new_status, message):
        """
        Append runner failure to the overall test status.
    
        :param test_state: Original test state (dict)
    Severity: Minor
    Found in avocado/core/runner.py - About 35 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

    There are no issues that match your filters.

    Category
    Status