Showing 30 of 32 total issues
Function generate_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generate_file(
- Create a ticketCreate a ticket
Function _run_hook_from_repo_dir
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _run_hook_from_repo_dir(
- Create a ticketCreate a ticket
Function determine_repo_dir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def determine_repo_dir(
template: str,
abbreviations: dict[str, str],
clone_to_dir: Path | str,
checkout: str | None,
- 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
Avoid too many return
statements within this function. Open
Open
return get_config(env_config_file)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return copy.copy(DEFAULT_CONFIG)
- Create a ticketCreate a ticket
Function run_script
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def run_script(script_path: str, cwd: Path | str = '.') -> None:
"""Execute a script from a working directory.
:param script_path: Absolute path to the script to run.
:param cwd: The directory to run the script from.
- 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
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
Consider possible security implications associated with subprocess module. Open
Open
import subprocess
- Create a ticketCreate a ticket
- Exclude checks