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 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 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 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 prompt_choice_for_config
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def prompt_choice_for_config(
- 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"