Function call with shell=True parameter identified, possible security issue. Open
cmd_result = process.run(cmd_format, verbose=False, shell=True)
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
cmd_result = process.run("rpm -qa | sort", verbose=False, shell=True)
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
process.run(f"rpm2cpio {abs_path} | cpio -dium -D {dest}", shell=True)
- Exclude checks
Function perform_setup
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def perform_setup(self, packages, no_dependencies=False):
"""
General RPM setup with automatic handling of dependencies based on
install 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
Function check_installed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_installed(self, name, version=None, arch=None):
"""
Check if package [name] is installed.
:param name: Package name.
- 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 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 too many return
statements within this function. Open
return False