Function call with shell=True parameter identified, possible security issue. Open
if process.system(cmd, ignore_status=True, sudo=True, shell=True):
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
wwids = process.run(cmd, ignore_status=True, sudo=True, shell=True).stdout_text
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
mpaths = process.run(cmd, ignore_status=True, sudo=True, shell=True).stdout_text
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
if not process.system(
f"multipath -c /dev/{disk_path}", sudo=True, ignore_status=True, shell=True
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
out = process.run(cmd, ignore_status=True, sudo=True, shell=True).stdout_text
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
mpaths = process.run(cmd, ignore_status=True, sudo=True, shell=True).stdout_text
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
wwids = process.run(cmd, ignore_status=True, sudo=True, shell=True).stdout_text
- Exclude checks
File multipath.py
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
Function get_mpath_paths_status
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_mpath_paths_status(wwid):
"""
Return the status of all paths of mpath device.
:param wwid: wwid or user friedly name of mpath.
- 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 get_path_status
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_path_status(disk_path):
"""
Return the status of a path in multipath.
:param disk_path: disk path. Example: sda, sdb.
- 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 get_policy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_policy(wwid):
"""
Gets path_checker policy, given a multipath wwid.
:return: path checker policy.
- 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 get_paths
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_paths(wwid):
"""
Get list of paths, given a multipath wwid.
:return: List of paths.
- 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 get_size
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_size(wwid):
"""
Gets size of device, given a multipath wwid.
:return: size of multipath device.
- 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"