Showing 157 of 157 total issues
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))
Avoid too many return
statements within this function. Open
return Iter(compress_or_select(item, self._iterator), size)
Avoid too many return
statements within this function. Open
return ast
Avoid too many return
statements within this function. Open
return Iter(_chunks_sizes_ex(n, seq, False, pad))
Avoid too many return
statements within this function. Open
return [x for key, x in zip(item, data) if key]
Avoid too many return
statements within this function. Open
return Iter(_chunks_sizes(n, seq))
Avoid too many return
statements within this function. Open
return fn(_juxt(*funcs))
Avoid too many return
statements within this function. Open
return Call(caller, args, kwargs)
Function consume_until
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def consume_until(self, n: int):
"""
Consume iterator until list reaches at most size 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 _is_identical
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _is_identical(
value,
name=None,
render=None,
doc=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 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(*args, **extra):
self, *args = args
cls = type(self)
args = dict(zip(self._meta.fields, args))
kwargs = dict(self._meta.defaults)
- 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 _
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _(ast):
# Optimizations:
# * Var nodes are handled more efficiently with operator.attrgetter
# * Call nodes are handled with operator.methodcaller, when possible
# * Chained getattrs are also handled with operator.attrgetter
- 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 __call__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, *args, **kwargs):
if not args and not kwargs:
raise TypeError("curried function cannot be called without arguments")
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 make_xor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_xor(f, g):
"""
Compose functions in a short-circuit version of xor using the following
table:
- 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 extract_fields_from_annotations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_fields_from_annotations(bases, ns):
annotations = {}
annotations.update(ns.get("__annotations__", ()))
for base in bases:
if isinstance(base, RecordMeta):
- 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 make_init_function_code
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_init_function_code(names_map: dict, defaults: Mapping) -> str:
"""
Return a string with source code for the init function.
"""
- 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 discard_child
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def discard_child(self, child, raises=False):
"""
Discard child if present in tree.
"""
for idx, elem in self._children:
- 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 parent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parent(self, value):
if value is None:
self._parent = None
elif not isinstance(value, Node):
raise TypeError(f"Parent node {value!r} is not of type 'Node'.")
- 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 _generator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _generator(self, iterator, default):
queue = self._tail_iters
pop = queue.popleft
yield from iterator
- 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"