Showing 32 of 96 total issues
File client.py
has 580 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Cluster Supporting Redis Client
"""
import collections
File strings.py
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Redis String Commands Mixin"""
# Python 2 support for ascii()
if 'ascii' not in dir(__builtins__): # pragma: nocover
from tredis.compat import ascii
File keys.py
has 527 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Redis Key Commands Mixin"""
from tornado import concurrent
# Python 2 support for ascii()
if 'ascii' not in dir(__builtins__): # pragma: nocover
File keys_tests.py
has 523 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import mock
import os
import time
import uuid
StringTests
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
class StringTests(base.AsyncTestCase):
@testing.gen_test
def test_append(self):
key, value1, value2 = self.uuid4(3)
File strings_tests.py
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
from tornado import gen
from tornado import testing
import tredis
KeyCommandTests
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
class KeyCommandTests(base.AsyncTestCase):
@testing.gen_test
def test_delete(self):
key, value = self.uuid4(2)
File sets.py
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Redis Set Commands Mixin"""
from tornado import concurrent
# Python 2 support for ascii()
if 'ascii' not in dir(__builtins__): # pragma: nocover
SetTests
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class SetTests(base.AsyncTestCase):
@testing.gen_test
def test_sadd_single(self):
key, value = self.uuid4(2)
KeysMixin
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class KeysMixin(object):
"""Redis Key Commands Mixin"""
def delete(self, *keys):
"""Removes the specified keys. A key is ignored if it does not exist.
StringsMixin
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class StringsMixin(object):
"""Redis String Commands Mixin"""
def append(self, key, value):
"""If key already exists and is a string, this command appends the
File sortedsets.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Redis Sorted Set Commands Mixin"""
class SortedSetsMixin(object):
"""Redis Sorted Set Commands Mixin"""
Function _on_connected
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _on_connected(self, future):
"""Invoked when connections have been established. If the client is
in clustering mode, it will kick of the discovery step if needed. If
not, it will select the configured database.
- 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 cluster_nodes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def cluster_nodes(self):
"""Each node in a Redis Cluster has its view of the current cluster
configuration, given by the set of known nodes, the state of the
connection we have with such nodes, their flags, properties and
assigned slots, and so forth.
- 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 _read
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _read(self, command, future):
"""Invoked when a command is executed to read and parse its results.
It will loop on the IOLoop until the response is complete and then
set the value of the response in the execution future.
- 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 sort
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sort(self,
key,
by=None,
external=None,
offset=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
Function _execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _execute(self, parts, expectation=None, format_callback=None):
"""Really execute a redis command
:param list parts: The list of command parts
:param mixed expectation: Optional response expectation
- 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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function parse_info_value
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_info_value(value):
"""
:param value:
:return:
- 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 sort
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def sort(self,