Showing 685 of 703 total issues
Function test_kill_process_tree_dont_timeout_3s
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def test_kill_process_tree_dont_timeout_3s(
Function change_one_value
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def change_one_value(self, matrix, row_index=None, column_index=None):
"""
Change one cell inside the matrix
:param matrix: matrix to be changed
- 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 _run_unittest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _run_unittest(cls, module_path, module_class_method, queue):
sys.path.insert(0, module_path)
stream = io.StringIO()
try:
- 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 set(copy[i]).issubset(set(copy[j])):
items_to_remove.add(copy[j])
for item in items_to_remove:
Avoid deeply nested control flow statements. Open
for pair in range(len(constraint[c])):
constraint_array.add(constraint[c][pair])
constraint_array = sorted(
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render(self, result, job):
json_output = job.config.get("job.run.result.json.output")
json_enabled = job.config.get("job.run.result.json.enabled")
if not (json_enabled or json_output):
- 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 bootstrap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
Avoid deeply nested control flow statements. Open
if candidate not in candidates:
candidates.append(candidate)
Function _fetch_asset
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _fetch_asset(name, asset_hash, algorithm, locations, cache_dirs, expire, queue):
Function _save_to_json
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _save_to_json(matrix, filename, verbose=False):
result = []
type_label_mapping = {}
for line in matrix:
- 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 nsid == ns_id and paths["Name"] == controller_name:
stat.extend([paths["State"], paths["ANAState"]])
return stat
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 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 not isinstance(old, list):
node.value[n] = [node.value[n]]
node.value[n].append(v)
Function vg_ramdisk
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def vg_ramdisk(
Function hash_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def hash_file(filename, size=None, algorithm="md5"):
"""
Calculate the hash value of filename.
If size is not None, limit to first size bytes.
- 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
with open(
os.path.join(root, metadata_file), "r", encoding="utf-8"
) as data:
metadata = json.loads(data.read())
if isinstance(metadata, dict):
Avoid deeply nested control flow statements. Open
for prule in rules[nextSym]:
ppos = self.skip(prule)
new = (prule, ppos)
NK.items.append(new)
#
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
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"