Showing 31 of 31 total issues
File concurrent.py
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""Coroutines concurrent pool executor with built-in
concurrency limit based on a semaphore free slots algorithm.
Usage::
Function curry
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def curry(arity_or_fn=None, ignore_kwargs=False, evaluator=None, *args, **kw):
"""
Creates a function that accepts one or more arguments of a function and
either invokes func returning its result if at least arity number of
arguments have been provided, or returns a function that accepts the
- 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 race
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def race(iterable, loop=None, timeout=None, *args, **kw):
"""
Runs coroutines from a given iterable concurrently without waiting until
the previous one has completed.
- 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 run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run(self,
timeout=None,
return_when=None,
return_exceptions=None,
ignore_empty=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 decorate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def decorate(fn):
"""
Generic decorator for coroutines helper functions allowing
multiple variadic initialization arguments.
- 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 flat_map
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def flat_map(coro, iterable, limit=0, loop=None, timeout=None,
Function each
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def each(coro, iterable, limit=0, loop=None,
Function times
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def times(coro, limit=1, raise_exception=False, return_value=None):
"""
Wraps a given coroutine function to be executed only a certain amount
of times.
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def map(coro, iterable, limit=0, loop=None, timeout=None,
Function gather
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def gather(*coros_or_futures, limit=0, loop=None, timeout=None,
preserve_order=False, return_exceptions=False):
"""
Return a future aggregating results from the given coroutine objects
with a concurrency execution limit.
- 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 gather
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def gather(*coros_or_futures, limit=0, loop=None, timeout=None,
Function throttle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def throttle(coro, limit=1, timeframe=1,
return_value=None, raise_exception=False):
"""
Creates a throttled coroutine function that only invokes
``coro`` at most once per every time frame of seconds or milliseconds.
- 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 wait
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def wait(*coros_or_futures, limit=0, timeout=None, loop=None,
Function reduce
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def reduce(coro, iterable, initializer=None, limit=1, right=False, loop=None):
Function until
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def until(coro, coro_test, assert_coro=None, *args, **kw):
Function currier
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def currier(arity, acc, fn, *args, **kw):
Function collect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def collect(coro, index, results,
Function throttle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def throttle(coro, limit=1, timeframe=1,
Function some
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def some(coro, iterable, limit=0, timeout=None, loop=None):
Function whilst
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def whilst(coro, coro_test, assert_coro=None, *args, **kw):