avocado-framework/avocado

View on GitHub
avocado/core/job.py

Summary

Maintainability
C
1 day
Test Coverage
B
83%

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert self.tmpdir is None, "Job.setup() already called"
Severity: Info
Found in avocado/core/job.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert self.tmpdir is not None, "Job.setup() not called"
Severity: Info
Found in avocado/core/job.py by bandit

File job.py has 575 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

    Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self, config=None, test_suites=None):
            """Creates an instance of Job class.
    
            Note that `config` and `test_suites` are optional, if not passed you
            need to change this before running your tests. Otherwise nothing will
    Severity: Minor
    Found in avocado/core/job.py - About 1 hr to fix

      Function cleanup has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def cleanup(self):
              """
              Cleanup the temporary job handlers (dirs, global setting, ...)
              """
              self.__stop_job_logging()
      Severity: Minor
      Found in avocado/core/job.py - About 45 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 _update_latest_link has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def _update_latest_link(self):
              """
              Update the latest job result symbolic link [avocado-logs-dir]/latest.
              """
      
      
      Severity: Minor
      Found in avocado/core/job.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