Function call with shell=True parameter identified, possible security issue. Open
if not process.run(cmd, shell=True, ignore_status=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
if process.system(cmd, shell=True, ignore_status=True):
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
if not process.run(cmd, shell=True, ignore_status=True):
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
output = process.run(cmd, shell=True, sudo=True, ignore_status=True).stdout_text
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
output = process.run(cmd, shell=True, sudo=True, ignore_status=True).stdout_text
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
data = 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
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
out = process.run(cmd, shell=True, ignore_status=True)
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
out = process.run(cmd, shell=True, ignore_status=True).stdout_text
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
process.run(cmd, shell=True, ignore_status=True)
- Exclude checks
Function call with shell=True parameter identified, possible security issue. Open
data = 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
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
if process.system(cmd, shell=True, ignore_status=True):
- Exclude checks
File nvme.py
has 295 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_ns_status
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_ns_status(controller_name, ns_id):
"""
Returns the status of namespaces on the specified controller
:param controller_name: name of the controller like nvme0
- 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_nslist_with_pci
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_nslist_with_pci(pci_address):
"""
Fetches and returns list of namespaces for specified pci_address
:param pci_address: pci_address of any nvme adapter
- 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
Avoid deeply nested control flow statements. Open
if paths["Address"] == pci_address:
ns_list.append(namespace["NSID"])
return ns_list
Function get_block_size
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_block_size(controller_name):
"""
Returns the block size of the namespace.
If not found, return defaults to 4k.
- 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_lba
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_lba(namespace):
"""
Returns LBA of the namespace. If not found, return defaults to 0.
:param namespace: nvme namespace like /dev/nvme0n1, /dev/nvme0n2 etc..
- 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"