Showing 895 of 913 total issues
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
for prule in rules[nextSym]:
ppos = self.skip(prule)
new = (prule, ppos)
NK.items.append(new)
#
Function read_gdb_response
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read_gdb_response(self, timeout=0.01, max_tries=100):
"""
Read raw responses from GDB
:param timeout: the amount of time to way between read attempts
- 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 nk is not None:
self.add(cur, (nk, i))
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 not isinstance(old, list):
node.value[n] = [node.value[n]]
node.value[n].append(v)
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 result.exit_status != 0:
errs.append("remove loop device")
LOGGER.error(
"Unexpected failure when removing loop"
"device %s, check the log",
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 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 __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
path=None,
port=None,
wait_until_running=True,
- 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 new not in cur:
self.links[key] = []
cur.append(new)
self.links[key].append((pptr, why))
Avoid deeply nested control flow statements. Open
if nsid == ns_id and paths["Name"] == controller_name:
stat.extend([paths["State"], paths["ANAState"]])
return stat
Function provides
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def provides(self, name):
"""
Searches for what provides a given file.
:param name: File path.
- 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 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 m.group(2).upper().startswith("SKIP"):
if count > 0:
yield self.Error("invalid SKIP directive for plan")
skipped = True
else:
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 _examine_class
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _examine_class(
Function make
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def make(
Function find_free_port
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_free_port(