Function call with shell=True parameter identified, possible security issue. Open
out = process.run(cmd, timeout=30, ignore_status=True, verbose=False, shell=True)
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
status = process.system(
cmd, timeout=30, ignore_status=True, verbose=False, shell=True, sudo=True
- Exclude checks
Function fail_on_dmesg
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def fail_on_dmesg(level=5):
"""Dmesg fail method decorator
Returns a class decorator used to signal the test when DmesgError
exception is raised.
- 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 collect_errors_by_level
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def collect_errors_by_level(output_file=None, level_check=5, skip_errors=None):
"""Verify dmesg having severity level of OS issue(s).
:param output_file: The file used to save dmesg
:type output_file: str
- 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 collect_errors_dmesg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def collect_errors_dmesg(patterns):
"""Check patterns in dmesg.
:param patterns : list variable to search in dmesg
:returns: error log in form of 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"