Showing 200 of 1,384 total issues
Function execute_query
has a Cognitive Complexity of 229 (exceeds 5 allowed). Consider refactoring. Open
def execute_query(cls, kind, spec, options, **kwargs): # pragma: no cover
""" Execute a :py:class:`model.Query` across one (or multiple) indexed
properties.
- Read upRead up
- Create a ticketCreate a ticket
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_query
has a Cognitive Complexity of 179 (exceeds 5 allowed). Consider refactoring. Open
def execute_query(cls, kind, spec, options, **kwargs): # pragma: no cover
""" Execute a query across one (or multiple) indexed properties. Collapses
a symbolic :py:class:`canteen.model.query.Query` object and attempts to
properly satisfy any ``Filter``/``Sort`` objects attached.
- Read upRead up
- Create a ticketCreate a ticket
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
File redis.py
has 1141 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
redis model adapter
- Create a ticketCreate a ticket
File __init__.py
has 1111 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
model
- Create a ticketCreate a ticket
Function to_dict
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
def to_dict(self, exclude=tuple(), include=tuple(),
filter=None, map=None, _all=False,
filter_fn=filter, map_fn=map,
convert_keys=True, convert_models=True, convert_datetime=True):
- Read upRead up
- Create a ticketCreate a ticket
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 collapse
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
def collapse(cls, spec=None):
""" Collapse available ``component`` items into a mapping of names to
objects which can respond to attribute requests for those paths.
- Read upRead up
- Create a ticketCreate a ticket
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
File abstract.py
has 728 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
abstract model adapters
- Create a ticketCreate a ticket
Function generate_indexes
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def generate_indexes(cls, key, entity=None, properties=None):
""" Generate a set of indexes that should be written to with associated
values, considering that some ``key`` values may be ``VertexKey`` or
``EdgeKey`` instances.
- Read upRead up
- Create a ticketCreate a ticket
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 clean_indexes
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
def clean_indexes(cls, writes, **kwargs):
""" Clean indexes for a key that is due to be deleted.
:param writes: Index writes that would be committed if the ``key`` was
- Read upRead up
- Create a ticketCreate a ticket
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
File query.py
has 672 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
model queries
- Create a ticketCreate a ticket
File template.py
has 646 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
template logic
- Create a ticketCreate a ticket
Function write_indexes
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
def write_indexes(cls, w, g, pipeline=None, execute=True):
""" Write a batch of index updates generated earlier via
:py:meth:`RedisAdapter.generate_indexes`.
- Read upRead up
- Create a ticketCreate a ticket
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 write_indexes
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
def write_indexes(cls, writes, _graph, execute=True):
""" Write a set of generated indexes via `generate_indexes`.
:param writes: Index writes to commit to the ``_metadata`` ``dict``.
- Read upRead up
- Create a ticketCreate a ticket
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 get_multi
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def get_multi(cls, keys, pipeline=None, **kwargs):
""" Retrieve a set of entity by Key from Redis, all in one go.
:param keys: Target iterable of :py:class:`model.Key` instances to
- Read upRead up
- Create a ticketCreate a ticket
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
File inmemory.py
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
in-memory model adapter
- Create a ticketCreate a ticket
Function build_message
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def build_message(_model):
""" Recursively builds a new `Message` class dynamically from a canteen
:py:class:`model.Model`. Properties are converted to their
:py:mod:`protorpc` equivalents and factoried into a full
- Read upRead up
- Create a ticketCreate a ticket
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 bind_urls
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def bind_urls(self):
""" Bind static asset URLs, if Canteen is instructed to handle requests for
static assets. Constructs handlers according to URLs and paths from
application configuration. """
- Read upRead up
- Create a ticketCreate a ticket
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
File __init__.py
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
RPC
- Create a ticketCreate a ticket
Function environment
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def environment(self, _handler, config):
""" Prepare a new :py:class:`jinja2.Environment` object, for the purpose
of rendering a template.
- Read upRead up
- Create a ticketCreate a ticket
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 _set_value
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def _set_value(self, name, value=EMPTY, _dirty=True):
""" Set (or reset) the value of a named property on this Entity.
:param name:
- Read upRead up
- Create a ticketCreate a ticket
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"