Showing 96 of 96 total issues
Function get_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_info(self: Self, path: PurePath | str, *, expand_user: bool = False, strict: bool = False) -> PathInfo:
path = Path(path)
has_ignore_error = hasattr(pathlib, "_ignore_error")
if not has_ignore_error:
logger.debug("No _ignore_error found; some OSErrors may be suppressed")
- 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 get_encoding
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_encoding(self: Self, encoding: str = "utf-8") -> str:
"""
Returns a text encoding from a more flexible string.
Ignores hyphens and lowercases the string.
Permits these nonstandard shorthands:
- 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 verify_can_write_dirs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def verify_can_write_dirs(
cls: type[Self],
*paths: str | PurePath,
missing_ok: bool = False,
) -> None:
- 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 approx_time_wrt
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def approx_time_wrt(
self: Self,
now: date | datetime,
then: date | datetime,
*,
- 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 strip_paired
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def strip_paired(self: Self, text: str, pieces: Iterable[tuple[str, str] | str]) -> str:
"""
Strips pairs of (start, end) from the ends of strings.
Example:
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function smart_log
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def smart_log(
self: Self,
is_stderr: bool,
line: bytes,
*,
- 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 pretty_object
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def pretty_object(self: Self, thing: Any, *, with_addr: bool = False) -> str:
"""
Get a better and shorter name for a function than str(function).
Ex: `pprint_function(lambda s: s) == '<λ>'`
- 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_default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_default(
self: Self,
*fallbacks: Callable[[Any], Any] | None,
first: Callable[[Any], Any] | None = _misc_types_default,
last: Callable[[Any], Any] | None = str,
- 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 sanitize_path
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sanitize_path(
Function write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(
Function only
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def only(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function encoder
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def encoder(
Function sanitize_node
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sanitize_node(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(