Showing 96 of 96 total issues
Function format_pint_quantity
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def format_pint_quantity(
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 dict_to_str
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def dict_to_str(
Function strip_any_ends
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def strip_any_ends(self: Self, s: str, prefixes: str | Sequence[str], suffixes: str | Sequence[str]) -> str:
"""
Flexible variant that strips any number of prefixes and any number of suffixes.
Also less type-safe than more specific variants.
Note that the order of the prefixes (or suffixes) DOES matter.
- 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 log_called_process_error
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def log_called_process_error(self: Self, e: CalledProcessError, *, log_fn: Callable[[str], None]) -> None:
"""
Outputs some formatted text describing the error with its full stdout and stderr.
Args:
- 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_function
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def pretty_function(self: Self, function: Callable, *, with_addr: bool = False) -> str:
n_args = str(function.__code__.co_argcount) if hasattr(function, "__code__") else "?"
pat = re.compile(r"^<bound method [^ .]+\.([^ ]+) of (.+)>$")
boundmatch = pat.fullmatch(str(function))
addr = " @ " + hex(id(function)) if with_addr else ""
- 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 add_reprs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_reprs(
fields: Collection[str] | None = None,
*,
exclude: Collection[str] | Callable[[str], bool] | None | Literal[False] = None,
exclude_from_str: Collection[str] | Callable[[str], bool] | None = 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 __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__(
Consider simplifying this complex logical expression. Open
if (
(is_list_with_inf or is_np_array_with_inf)
and (is_list_with_nan or is_list_with_nan)
and inf_handling is NanInfHandling.convert_to_null
and nan_handling is NanInfHandling.convert_to_str
Consider simplifying this complex logical expression. Open
if (
(is_list_with_inf or is_np_array_with_inf)
and (is_list_with_nan or is_list_with_nan)
and inf_handling is NanInfHandling.convert_to_str
and nan_handling is NanInfHandling.convert_to_null
Consider simplifying this complex logical expression. Open
if (
(is_list_with_inf or is_np_array_with_inf or is_list_with_nan or is_list_with_nan)
and inf_handling is NanInfHandling.convert_to_str
and nan_handling is NanInfHandling.convert_to_str
):
Function hash_digest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def hash_digest(
Function approx_time_wrt
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def approx_time_wrt(
Function natsort
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def natsort(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function smart_log
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def smart_log(
Function gen_list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def gen_list(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(