Showing 155 of 157 total issues
Function from_operator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_operator(cls, op, unit=None, unit_factory=None, *, inv):
Function lazy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def lazy(
Function alias
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def alias(attr, *, transform=None, prepare=None, **kwargs) -> Any:
Function delegate_to
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delegate_to(attr, *, transform=None, prepare=None, **kwargs):
Function _iterate_indexed_n
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _iterate_indexed_n(func, index, args):
n = len(args)
try:
yield from args
if n == 2:
- 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 __getitem__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __getitem__(self, i: int) -> NodeOrLeaf:
if isinstance(i, int):
if i == 0 or i == len(self._children):
return self.tag
if i > 0:
- 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 iterate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def iterate(func: Callable[..., T], x: T, *args, index: Index = None):
f"""
Repeatedly apply a function func to input.
If more than one argument to func is passed, it iterate over the past n
- 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 _iterate_n
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _iterate_n(func, args):
n = len(args)
try:
yield from args
if n == 2:
- 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 wrap_fn_functions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def wrap_fn_functions(globs: Dict[str, Any], lst=None, exclude=()):
"""
Wraps all function in namespace using fn.
This avoids the @fn decorator that sometimes confuses static checkers.
- 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 _next_function
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _next_function(self, iterator, default, next=next, not_given=NOT_GIVEN):
stack = self._cursor_stack
pop = stack.pop
def yield_next():
- 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 __getattr__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __getattr__(self, item):
if item in self.__all__:
for package in get_subpackages(self):
try:
value = get_item(package, item)
- 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 any_pred
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def any_pred(*predicates):
"""
Return a new predicate function that performs a logic OR to all arguments.
This behaves in a short-circuit manner and returns the first truthy result,
- 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_handlers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def bind_handlers(func_or_mod, handlers, methods):
"""
Receive a function and a mapping from {(mime, method): handler_factory}
and return a populated mapping of handlers.
"""
- 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 to_function
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_function(func: Any, name=None, keep_signature=False) -> FunctionType:
"""
Return object as as Python function.
Non-functions are wrapped into a function definition.
- 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 all_pred
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def all_pred(*predicates):
"""
Return a new predicate that performs an logic AND to all predicate
functions.
- 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 tree_leaves
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tree_leaves(root: Seq, *, follow: Pred = is_seqcont, children: Func = iter) -> Seq:
"""
A way to list or iterate over all the tree leaves.
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 period_cache
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def period_cache(
key: str,
fn: callable,
*,
period: Union[str, int, datetime.timedelta],
- 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 delegate_to
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def delegate_to(attr, *, transform=None, prepare=None, **kwargs):
"""
Delegate access to an inner variable.
A delegate is an alias for an attribute of the same name that lives in an
- 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 [data[i] for i in item]
Avoid too many return
statements within this function. Open
return Iter(_chunks_split(func, seq))