cookiecutter/cookiecutter

View on GitHub
cookiecutter/hooks.py

Summary

Maintainability
A
1 hr
Test Coverage
A
100%

Consider possible security implications associated with subprocess module.
Open

import subprocess
Severity: Info
Found in cookiecutter/hooks.py by bandit

Function run_hook_from_repo_dir has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def run_hook_from_repo_dir(
Severity: Minor
Found in cookiecutter/hooks.py - About 35 mins to fix

Function run_script has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
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.
Severity: Minor
Found in cookiecutter/hooks.py - About 25 mins to fix

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

There are no issues that match your filters.

Category
Status