Showing 494 of 703 total issues
Function get_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_file(
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 _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 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
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 _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 identifier
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def identifier(self):
"""Runnable identifier respecting user's format string.
This is still experimental and we have room for improvements.
- 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 _must_key_val_matches(
must_key_val, test_tags, include_empty_key
):
continue
Function merge_with_arguments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def merge_with_arguments(self, arg_parse_config):
"""Merge the current settings with the command-line args.
After parsing argument options this method should be executed to have
an unified settings.
- 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 _create_connection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _create_connection(self):
"""
Creates connection with `self.uri` based on `socket.create_connection`
"""
if ":" in self.uri:
- 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__(self, kind, uri, *args, config=None, identifier=None, **kwargs):
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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function emit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def emit(self, record):
try:
msg = self.format(record)
if record.levelno < logging.INFO: # Most messages are INFO
pass
- 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 from_avocado_config
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_avocado_config(
Avoid deeply nested control flow statements. Open
if not must_flat.issubset(test_tags):
continue
Consider simplifying this complex logical expression. Open
if len(line) > 2 and (line[:3] == "+++" or line[:3] == "---"):
continue
# ignore line range information in the output
elif len(line) > 1 and line[:2] == "@@":
continue
Function _test
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _test(self, name, content, exp_str, mode=MODE_0664, count=1):
Function fetch_assets
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fetch_assets(