Showing 490 of 907 total issues
Avoid deeply nested control flow statements. Open
if nk is not None:
self.add(cur, (nk, i))
Avoid deeply nested control flow statements. Open
if new not in cur:
self.links[key] = []
cur.append(new)
self.links[key].append((pptr, why))
Function find_rpm_packages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_rpm_packages(self, rpm_dir):
"""
Extract product dependencies from a defined RPM directory and all its subdirectories.
:param str rpm_dir: directory to search in
- 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 param_type is not None:
param_dic["type"] = param_type.group(1)
param_list.append(param_dic)
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
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 get_tasks_in_topological_order
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_tasks_in_topological_order(self):
"""Computes the topological order of runtime tasks in graph
:returns: runtime tasks in topological order
:rtype: list
- 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 _set_collectibles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _set_collectibles(self):
timeout = self.config.get("sysinfo.collect.commands_timeout")
locale = self.config.get("sysinfo.collect.locale")
if self.profiler:
for cmd in self.sysinfo_files["profilers"]:
- 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 make
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def make(
Function check_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_file(
path,
reference,
suffix=".py",
type_check=os.path.isfile,
- 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_test_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _extend_test_list(current, new):
for test in new:
test_method_name = test[0]
found = False
for current_test in current:
- 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 get_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_file(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
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:
Avoid deeply nested control flow statements. Open
if key in result:
result[key].add(val)
else:
result[key] = {val}
else:
Function _examine_class
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _examine_class(
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 config_filename
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def config_filename(self):
current_distro = distro_detect()
if current_distro.name in ["rhel", "fedora"]:
if self.distro_is_rhel9_or_later:
path = "/etc/NetworkManager/system-connections"
- 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"
Further reading
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