Showing 9 of 9 total issues
Function clip
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def clip(
name: str,
bump: Optional[str],
test: bool,
lint: bool,
- Read upRead up
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 pr
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def pr(
Function clip
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def clip(
Function new_checksums
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def new_checksums(
website: Annotated[str, Is[lambda text: text[:4] == "http"]],
distfile: Optional[Port] = None,
) -> Tuple[str, str, str]:
"""Generate checksums of file downloaded from website.
- Read upRead up
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 perform_test
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def perform_test(name: str, subport: Optional[str] = None) -> bool:
"""Tests the port and checks output for errors.
Args:
name: The name of the port
- Read upRead up
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 new_version
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def new_version(port: Port, stated: Optional[str], new: bool = False) -> str:
"""Determines livecheck version, and sees whether already up-to-date.
Args:
port: The port class
- Read upRead up
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
return "/usr/bin"
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, name: str) -> None:
"""Set optional attributes and check if port exists."""
# TODO: Figure out how to find path without subprocess
# TODO: Refactor this
# TODO: This also kind of defeats the purpose of that bandit error, so find a better way to determine the path
- Read upRead up
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 user_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def user_path(
port: bool = False, third_party: bool = False, manual: Optional[str] = None
) -> str:
"""Determines the bin path to prevent starting a process with a partial executable path.
- Read upRead up
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"