Showing 34 of 52 total issues
Function tornado_combiner
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def tornado_combiner(configs, use_gevent=False, start=True, monkey_patch=None,
Container=None, Server=None, threadpool=None): # pragma: no cover
"""Combine servers in one tornado event loop process
:param configs: [
- 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 tornado_combiner
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def tornado_combiner(configs, use_gevent=False, start=True, monkey_patch=None,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, handler, logger, autoack=True,
Function add_queue_rule
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_queue_rule(self, handler, name, autoack=True, prefetch_size=0,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function queue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def queue(self, name, autoack=True, prefetch_size=0, prefetch_count=0,
Function url_for
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def url_for(self, resource='', query=None, params='', fragment='',
Function gevent_run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def gevent_run(app, monkey_patch=True, start=True, debug=False,
Function __call__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, immediate=False, sleep=None): # pragma: no cover
if use_gevent:
self._calls += 1
if self._calls >= self.max_calls or immediate:
self._calls = 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
Avoid too many return
statements within this function. Open
return url
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, connection='amqp:///', logger=None, timeout=1, name=None,
workers=None, pool_factory=ThreadPool, reconnect_timeout=1,
reconnect_enable=True, workers_override_prefetch=True,
immediate_connect=True):
"""Initialization
- 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 test_workers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_workers(self):
from microservices.queues.service import Microservice
from microservices.queues.client import Client
microservice = Microservice('memory:///', timeout=0.01, workers=5)
- 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 request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def request(self, method, *resources, **kwargs):
method = method.upper()
response_key = kwargs.pop('response_key', None)
key = kwargs.pop('key', None)
if key is not 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 test_service
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_service(self):
from microservices.queues.service import Microservice
from microservices.queues.client import Client
from kombu.connection import Connection
- 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"