Showing 157 of 157 total issues
Function run
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(
Function pprint
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def pprint(
Function _is_identical
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _is_identical(
Function throttle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def throttle(
dt: float,
func: Func,
policy: Literal["last", "block"] = "last",
clock: Callable[[], T] = time.monotonic,
- 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 curry
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def curry(n, func=None): # noqa: F811
"""
Return the curried version of a function of n arguments.
Curried functions return partial applications of the function if called with
- 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 args
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def args(self, how="short") -> Tuple[type, ...]:
"""
Return a tuple with function argument types.
"""
- 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 __eq__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __eq__(self, other):
if not isinstance(other, list):
return NotImplemented
if isinstance(other, LazyList):
- 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 iter_children
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def iter_children(
node,
how=None,
*,
self: bool = 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 retry
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def retry(n: int, func: Func, *, error: Catchable = Exception, sleep=None) -> fn:
"""
Retry to execute function at least n times before raising an error.
This is useful for functions that may fail due to interaction with external
- 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 _bind
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _bind(*args, **kwargs):
self, partial, *args = args
n_sigs = len(self.signatures)
for n, sig in enumerate(self.signatures, 1):
try:
- 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 from_semigroup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def from_semigroup(cls, semigroup, unit=None, unit_factory=None):
"""
Creates a monoid from semigroup, supplying the unit element or the unit
factory.
"""
- 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 _drop_at_lazy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _drop_at_lazy(indices, seq):
idx = next(indices, None)
if idx is None:
return
for i, x in enumerate(seq):
- 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_record_type
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def new_record_type(
Function pformat
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def pformat(obj, indent=1, width=80, depth=None, *, compact=False, **options) -> str:
Function wrap_function
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def wrap_function(
fn: Callable,
parse_value: Callable[[str], Any] = None,
display: Callable[[Any], str] = None,
) -> Callable:
- 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 __eq__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __eq__(a, b):
nil = Nil
if isinstance(b, List):
while a is not nil and b is not nil:
if a is b:
- 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 __ge__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __ge__(a, b):
nil = Nil
if isinstance(b, List):
while a is not nil and b is not nil:
if a is b:
- 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 ttl_cache
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ttl_cache(key, fn, *, timeout=6 * 3600, memory=None, **cache_kwargs):
Function retry
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def retry(
Function first_error
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def first_error(*args):
"""
Return the first error in a sequence of Result values.
If no value is an error, return 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"