Showing 30 of 32 total issues
Function unzip
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def unzip(
zip_uri: str,
is_url: bool,
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 prompt_for_config
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def prompt_for_config(
context: dict[str, Any], no_input: bool = False
) -> OrderedDict[str, Any]:
"""Prompt user to enter a new config.
- 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
File generate.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Functions for generating a project from a project template."""
from __future__ import annotations
import fnmatch
- Create a ticketCreate a ticket
File prompt.py
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Functions for prompting the user for project info."""
from __future__ import annotations
import json
- Create a ticketCreate a ticket
Function apply_overwrites_to_context
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def apply_overwrites_to_context(
context: dict[str, Any],
overwrite_context: dict[str, Any],
*,
in_dictionary_variable: 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 clone
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. 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 cookiecutter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def cookiecutter(
template: str,
checkout: str | None = None,
no_input: bool = False,
extra_context: dict[str, Any] | None = 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
Function slugify
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def slugify(
- Create a ticketCreate a ticket
Function read_user_choice
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def read_user_choice(var_name: str, options: list, prompts=None, prefix: str = ""):
"""Prompt the user to choose from several options for the given variable.
The first item will be returned if no input happens.
- 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 get_user_config
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_user_config(
config_file: str | None = None,
default_config: bool | dict[str, Any] = False,
) -> dict[str, Any]:
"""Return the user config as a dict.
- 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 prompt_and_delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def prompt_and_delete(path: Path | str, no_input: bool = False) -> bool:
"""
Ask user if it's okay to delete the previously-downloaded file/directory.
If yes, delete it. If no, checks to see if the old version should be
- 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
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"
Further reading
Function prompt_choice_for_config
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def prompt_choice_for_config(
- Create a ticketCreate a ticket
Function determine_repo_dir
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def determine_repo_dir(
- Create a ticketCreate a ticket
Function generate_files
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_files(
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if chunk: # filter out keep-alive new chunks
f.write(chunk)
else:
- Create a ticketCreate a ticket
Function render_variable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render_variable(
env: Environment,
raw: _Raw,
cookiecutter_dict: dict[str, Any],
) -> str:
- 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 run_hook_from_repo_dir
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_hook_from_repo_dir(
- Create a ticketCreate a ticket
Function render_and_create_dir
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_and_create_dir(
- Create a ticketCreate a ticket
Function unzip
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def unzip(
- Create a ticketCreate a ticket