datalad_container/adapters/docker.py
Consider possible security implications associated with subprocess module. Open
Open
import subprocess as sp
- Exclude checks
subprocess call - check for execution of untrusted input. Open
Open
sp.check_call(cmd)
- Exclude checks
subprocess call - check for execution of untrusted input. Open
Open
out = sp.check_output(
["docker", "images", "--all", "--quiet", "--no-trunc"])
- Exclude checks
Starting a process with a partial executable path Open
Open
sp.check_call(["docker", "save", "-o", stream.name, image])
- Exclude checks
subprocess call - check for execution of untrusted input. Open
Open
sp.check_call(["docker", "save", "-o", stream.name, image])
- Exclude checks
Probable insecure usage of temp file/directory. Open
Open
prefix = ["docker", "run",
# FIXME: The -v/-w settings are convenient for testing, but they
# should be configurable.
"-v", "{}:/tmp".format(os.getcwd()),
"-w", "/tmp",
- Exclude checks
subprocess call - check for execution of untrusted input. Open
Open
p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
- Exclude checks
Starting a process with a partial executable path Open
Open
out = sp.check_output(
["docker", "images", "--all", "--quiet", "--no-trunc"])
- Exclude checks
Function save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def save(image, path):
"""Save and extract a docker image to a directory.
Parameters
----------
- 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 safe_extract
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def safe_extract(tar, path=".", members=None, *, numeric_owner=False):