Showing 96 of 96 total issues
Function gen_html
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def gen_html(
Function stream_cmd_call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def stream_cmd_call(
Function gen_str
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def gen_str(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function sanitize_nodes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sanitize_nodes(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function status
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def status(level: int | str | CodeStatus, vr: str | None = "", msg: str | None = None) -> Callable[..., Any]:
"""
Annotate code quality. Emits a warning if bad code is called.
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 _un_leaf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _un_leaf(cls: type[Self], to: MutableMapping[str, Any], items: Mapping[str, Any]) -> None:
for k, v in items.items():
if "." not in k:
to[k] = v
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 normalize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def normalize(self: Self) -> Self:
s = ""
if self.append:
s += "a"
elif self.safe:
- 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 _re_leaf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _re_leaf(cls: type[Self], at: str, items: Mapping[str, Any]) -> Iterable[tuple[str, Any]]:
for k, v in items.items():
me = at + "." + k if len(at) > 0 else k
if hasattr(v, "items") and hasattr(v, "keys") and hasattr(v, "values"):
yield from cls._re_leaf(me, v)
- 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 list(obj)
Avoid too many return
statements within this function. Open
return wraps(func)(my_fn)
Avoid too many return
statements within this function. Open
return obj.tzname(datetime.now(tz=obj))
Avoid too many return
statements within this function. Open
return str(data)
Avoid too many return
statements within this function. Open
return s
Avoid too many return
statements within this function. Open
return dict(obj)
Avoid too many return
statements within this function. Open
return data.tolist()
Avoid too many return
statements within this function. Open
return "⟨" + s + addr + "⟩"
Avoid too many return
statements within this function. Open
return str(thing)
Avoid too many return
statements within this function. Open
return then.strftime(_today + "%H:%M:%S") + "." + str(round(then.microsecond / 1000))