sgammon/canteen

View on GitHub

Showing 200 of 1,384 total issues

Function execute_query has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def execute_query(cls, kind, spec, options, **kwargs):
Severity: Minor
Found in canteen/model/adapter/abstract.py - About 35 mins to fix

Function resolve has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def resolve(mcs, name, bases, properties, default=True):
Severity: Minor
Found in canteen/model/__init__.py - About 35 mins to fix

Function compile has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def compile(self, environment, source, destination,
Severity: Minor
Found in canteen/logic/template.py - About 35 mins to fix

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def __init__(self, value,
Severity: Minor
Found in canteen/model/query.py - About 35 mins to fix

Function _pluck_indexed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def _pluck_indexed(entity):

    """ Override the indexed property scanner to ignore ``Edge``-related auto-
        injected properties.

Severity: Minor
Found in canteen/model/adapter/abstract.py - About 35 mins to fix

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 commit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def commit(self, request, response, session):

        """  """

        # resolve serializer
Severity: Minor
Found in canteen/logic/http/cookies.py - About 35 mins to fix

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 clear has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def clear(name=None):

    """ Clear the entire contents of a ``name``d cache. If no name is provided,
        will clear contents of *all known* caches.

Severity: Minor
Found in canteen/logic/cache.py - About 35 mins to fix

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 download_setuptools has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def download_setuptools(
    version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
    delay=15
):
    """Download setuptools from a specified location and return its filename
Severity: Minor
Found in ez_setup.py - About 35 mins to fix

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 __iter__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def __iter__(self):

    """ Allow models to be used as dict-like generators.

        :returns: """
Severity: Minor
Found in canteen/model/__init__.py - About 35 mins to fix

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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def __init__(self, kind=None, filters=None, sorts=None, **kwargs):

    """ Initialize this :py:class:`Query`, assigning any properties/config
        passed in via ``kwargs`` and such.

Severity: Minor
Found in canteen/model/query.py - About 35 mins to fix

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 mro has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def mro(cls):

    """ Assemble MRO (Method Resolution Order) to enable proper class composure
        patterns for ``MetaFactory``.

Severity: Minor
Found in canteen/core/meta.py - About 35 mins to fix

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 overlay has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def overlay(self, other, override=False):

    """ Combine this :py:class:`QueryOptions` object with another one, by
        merging the ``other`` object's settings into this one.

Severity: Minor
Found in canteen/model/query.py - About 35 mins to fix

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_option has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def _get_option(self, name, default=EMPTY):

    """ Get the value of an option local to this :py:class:`QueryOptions`
        object.

Severity: Minor
Found in canteen/model/query.py - About 35 mins to fix

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 result_entities
Severity: Major
Found in canteen/model/adapter/inmemory.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        if profile: return impl(**profile)
Severity: Major
Found in canteen/model/adapter/redis.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return _mock_redis
Severity: Major
Found in canteen/model/adapter/redis.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return _spec_item  # pragma: no cover
Severity: Major
Found in canteen/model/__init__.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return client
Severity: Major
Found in canteen/model/adapter/redis.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return iter([handler])  # it's a static response!
Severity: Major
Found in canteen/core/runtime.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return iter([result])
Severity: Major
Found in canteen/core/runtime.py - About 30 mins to fix
Severity
Category
Status
Source
Language