avocado/core/job.py
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert self.tmpdir is None, "Job.setup() already called"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert self.tmpdir is not None, "Job.setup() not called"
- Exclude checks
File job.py
has 575 lines of code (exceeds 250 allowed). Consider refactoring. Open
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.
#
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function cleanup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def cleanup(self):
"""
Cleanup the temporary job handlers (dirs, global setting, ...)
"""
self.__stop_job_logging()
- Read upRead up
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
Open
def _update_latest_link(self):
"""
Update the latest job result symbolic link [avocado-logs-dir]/latest.
"""
- Read upRead up
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"