Showing 157 of 157 total issues
Function catch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def catch(exc: Union[Catchable, Dict[Catchable, Any]], func: Func, /, *args, **kwargs):
"""
Handle exception in function. If the exception occurs, it executes the given
handler.
- 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 _stub_declarations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _stub_declarations(self) -> Iterable[str]:
name = self.name
if len(self.signatures) == 0:
yield f"def {name}(*args, **kwargs) -> Any: ..."
- 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 define
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def define(
Function clean_field
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clean_field(field, use_invalid=False):
"""
Coerce argument to a Field instance.
"""
tt = object
- 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 __gt__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __gt__(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 map
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def map(func: Func, *seqs: Seq, index: Index = None, product: bool = None) -> Iter:
"""
Evaluate function at elements of sequences.
sk.map(func, *seqs) ==> f(X[0], Y[0], ...), f(X[1], Y[1], ...), ...
- 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 set_null
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_null(func, /, *defaults: Any, **kwargs) -> fn:
"""
Return a new function that replace all null arguments in the given positions
by the provided default value.
"""
- 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 wrapped_func
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def wrapped_func(printer, obj, stream, indent, allowance, context, level):
Function retry
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def retry(
Function thread_if
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def thread_if(data, *forms):
"""
Similar to thread, but each form must be a tuple with (test, fn, ...args)
and only pass the argument to fn if the boolean test is True.
- 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_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 normalize_field_mapping
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_field_mapping(fields):
"""
Normalize each declaration in a field mapping.
"""
for name, value in fields.items():
- 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 rtake
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def rtake(key: Union[Pred, int], seq: Seq) -> Iter:
"""
Return the last entries iterable.
Examples:
- 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 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"
Further reading
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, data, **kwargs):
self.data = data
self.pre_setitem = []
self.post_setitem = []
self.pre_delitem = []
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def iter_children(
Function replace_child
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def replace_child(self, child, other, raises=False, append=False):
"""
Replace element for child.
"""
other.parent = self
- 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 pure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def pure(name, type, ns, *, arity=None, flip=False):
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"