subprocess call - check for execution of untrusted input. Open
proc = subprocess.run(
[zstd_cmd, "-d"],
input=ZSTD_AVOCADO,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- Exclude checks
subprocess call - check for execution of untrusted input. Open
proc = subprocess.run(
[zstd_cmd, "-d", path, "-o", output_path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False,
- Exclude checks
Consider possible security implications associated with subprocess module. Open
import subprocess
- Exclude checks
File archive.py
has 288 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 _update_zip_extra_attrs
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _update_zip_extra_attrs(self, dst_dir):
if platform.system() != "Linux":
LOG.warning("Attr handling in zip files only supported on Linux.")
return
# Walk all files and re-create files as symlinks
- 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 compress
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def compress(filename, path):
"""
Compress files in an archive.
:param filename: archive file 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 gzip_uncompress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gzip_uncompress(path, output_path):
"""
Uncompress a gzipped file at path, to either a file or dir at output_path
"""
with gzip.GzipFile(filename=path, mode="rb") as input_file:
- 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"