Showing 32 of 96 total issues
Function migrate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def migrate(self,
Function _encode_resp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _encode_resp(self, value):
"""Dynamically build the RESP payload based upon the list provided.
:param mixed value: The list of command parts to encode
:rtype: bytes
- 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 zrangebyscore
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def zrangebyscore(self,
Function set
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def set(self, key, value, ex=None, px=None, nx=False, xx=False):
Function zadd
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def zadd(self, key, *members, **kwargs):
"""Adds all the specified members with the specified scores to the
sorted set stored at key. It is possible to specify multiple score /
member pairs. If a specified member is already a member of the sorted
set, the score is updated and the element reinserted at the right
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function setup_module
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setup_module():
try:
with open('build/test-environment') as env_file:
for line_num, line in enumerate(env_file):
if line.startswith('export '):
- 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 expiring_set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def expiring_set(self, key, value, expiration=None, nx=None, xx=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function auth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def auth(self, password):
"""Request for authentication in a password-protected Redis server.
Redis can be instructed to require a password before allowing clients
to execute commands. This is done using the ``requirepass`` directive
in the configuration file.
- 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 b''.join(output)
Function _pick_cluster_host
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _pick_cluster_host(self, value):
"""Selects the Redis cluster host for the specified value.
:param mixed value: The value to use when looking for the host
:rtype: tredis.client._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"