Showing 494 of 703 total issues
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render(self, result, job):
xunit_enabled = job.config.get("job.run.result.xunit.enabled")
xunit_output = job.config.get("job.run.result.xunit.output")
if not (xunit_enabled or xunit_output):
return
- 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 lv_create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def lv_create(
Avoid deeply nested control flow statements. Open
if isinstance(metadata, dict):
if metadata.get("type", None) == "vmimage":
provider = None
for p in vmimage.IMAGE_PROVIDERS:
if p.name == metadata["name"]:
Avoid deeply nested control flow statements. Open
if paths["Address"] == pci_address:
ns_list.append(namespace["NSID"])
return ns_list
Avoid deeply nested control flow statements. Open
if nk is not None:
self.add(next_item, (nk, i + 1))
Avoid deeply nested control flow statements. Open
if line.startswith(b"CPU architecture"):
version = int(line.split(b":", 1)[1])
if version >= 8:
return "aarch64"
else:
Function make
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def make(
Function end
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def end(self, status=""):
"""
Logging hook called whenever a job finishes.
"""
optimized = self.config.get("sysinfo.collect.optimize")
- 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 _extend_directory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _extend_directory(path):
if not os.path.isdir(path):
return [path]
paths = []
# no error handling so far
- 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 unmount
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def unmount(self, force=True):
"""
Umount this partition.
It's easier said than done to umount a partition.
- 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
Avoid deeply nested control flow statements. Open
if parts[1] == self.mountpoint:
return parts[1] # The mountpoint where it's mounted
return None
Avoid deeply nested control flow statements. Open
async with self._state_machine.lock:
self._state_machine.triaging.append(runtime_task)
runtime_task.status = RuntimeTaskStatus.WAIT
await asyncio.sleep(0.1)
return
Function find_free_port
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_free_port(
Function discover
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def discover(self):
resolutions = []
for ext in self.extensions:
try:
results = ext.obj.discover()
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if m.group(2).upper().startswith("SKIP"):
if count > 0:
yield self.Error("invalid SKIP directive for plan")
skipped = True
else:
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, uid, name, variant=None, no_digits=None):
"""
Constructs a TestID instance
:param uid: unique test id (within the job)
- 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start(self):
"""Log all collectibles at the start of the event."""
os.environ["AVOCADO_SYSINFODIR"] = self.pre_dir
for log_hook in self.start_collectibles:
# log daemons in profile directory
- 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 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()
- 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 handle_starttag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_starttag(self, tag, attrs):
if tag != "a":
return
for attr in attrs:
if attr[0] == "href" and re.match(self.pattern, attr[1]):
- 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"