cookiecutter/vcs.py
subprocess call - check for execution of untrusted input. Open
Open
subprocess.check_output(
[repo_type, 'checkout', *checkout_params],
cwd=repo_dir,
stderr=subprocess.STDOUT,
- Create a ticketCreate a ticket
- Exclude checks
subprocess call - check for execution of untrusted input. Open
Open
subprocess.check_output(
[repo_type, 'clone', repo_url],
cwd=clone_to_dir,
stderr=subprocess.STDOUT,
- Create a ticketCreate a ticket
- Exclude checks
Consider possible security implications associated with subprocess module. Open
Open
import subprocess
- Create a ticketCreate a ticket
- Exclude checks
Function clone
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def clone(
repo_url: str,
checkout: str | None = None,
clone_to_dir: Path | str = ".",
no_input: bool = False,
- Read upRead up
- Create a ticketCreate a ticket
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 identify_repo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def identify_repo(repo_url: str) -> tuple[Literal["git", "hg"], str]:
"""Determine if `repo_url` should be treated as a URL to a git or hg repo.
Repos can be identified by prepending "hg+" or "git+" to the repo URL.
- Read upRead up
- Create a ticketCreate a ticket
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"