sgammon/canteen

View on GitHub

Showing 200 of 1,384 total issues

Function __call__ has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

  def __call__(self, target):

    """ Dispatch this binding (the second half of a closured decorator flow) by
        scanning the target for subbindings (if applicable) and preparing (and
        subsequently attaching) an object to describe configuration.
Severity: Minor
Found in canteen/util/decorators.py - About 7 hrs 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 __new__ has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    def __new__(mcs, name, bases, properties):

      """ Check to see if we're initializing a new subcommand class, and if we
          are, construct the appropriate subparser.

Severity: Minor
Found in canteen/util/cli.py - About 6 hrs 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

File cache.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""

  caching logic
Severity: Minor
Found in canteen/logic/cache.py - About 5 hrs to fix

Function initialize has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize(mcs, name, bases, properties):

      """ Initialize a ``Model`` descendent for use as a
          data model class. Reorganizes class internals
          to store descriptors for defined user data
Severity: Minor
Found in canteen/model/__init__.py - About 5 hrs 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 run has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

  def run(output=None,
          suites=None,
          scope=(AppTest, FrameworkTest),
          _format='text',
          verbosity=1, **kwargs):  # pragma: nocover
Severity: Minor
Found in canteen/test.py - About 5 hrs 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

File runtime.py has 399 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""

  core runtime
Severity: Minor
Found in canteen/core/runtime.py - About 5 hrs to fix

Function dispatch has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

  def dispatch(self, environ, start_response):

    """ WIP """

    from ..base import handler as base_handler
Severity: Minor
Found in canteen/core/runtime.py - About 4 hrs 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 valid has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

  def valid(self, instance):

    """ Validate the value of this property, if any.

        :param instance:
Severity: Minor
Found in canteen/model/__init__.py - About 4 hrs 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

File core.py has 360 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""

  core model adapters
Severity: Minor
Found in canteen/model/adapter/core.py - About 4 hrs to fix

Function inject has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def inject(cls):

      """ Parse/consider bindings attached to the target ``cls``, providing the
          final concrete class and set of injectable items.

Severity: Minor
Found in canteen/core/meta.py - About 4 hrs 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 channel has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

  def channel(cls, kind):

    """ Retrieve a write channel to Redis.

        :param kind: String :py:class:`model.Model` kind to retrieve a channel
Severity: Minor
Found in canteen/model/adapter/redis.py - About 4 hrs 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 resolve has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

  def resolve(mcs, name, bases, properties, default=True):

    """ Resolve a suitable model adapter for a given model Key or Model.

        :param name: Class name, as provided to :py:meth:`__new__`.
Severity: Minor
Found in canteen/model/__init__.py - About 3 hrs 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

File struct.py has 318 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""

  datastructures
Severity: Minor
Found in canteen/util/struct.py - About 3 hrs to fix

Function execute_hooks has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  def execute_hooks(cls, points, *args, **kwargs):

    """  """

    if isinstance(points, basestring): points = (points,)
Severity: Minor
Found in canteen/core/runtime.py - About 3 hrs 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 clirunner has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  def clirunner(arguments, root=None):  # pragma: nocover

    """ Discover and run known testsuites. Optionally scope to a certain
        ``root`` directory, or provide alternate output options.

Severity: Minor
Found in canteen/test.py - About 3 hrs 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 template_ast has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

  def template_ast(self, node, frame=None):  # pragma: no cover

    """ Shim for Jinja2's default ``Jinja``-sytnax-to-Python AST converter.
        Wraps template code in a module-level ``run`` function that binds it
        to an instance of :py:class:`jinja2.Environment`.
Severity: Minor
Found in canteen/logic/template.py - About 3 hrs 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 compile_dir has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def compile_dir(self, source, destination,
                          base_dir='',
                          pattern=_DEFAULT_TEMPLATE_PATTERN,
                          encoding='utf-8',
                          fill_init=True):
Severity: Minor
Found in canteen/logic/template.py - About 3 hrs 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

File handler.py has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""

  handler base
Severity: Minor
Found in canteen/base/handler.py - About 3 hrs to fix

File agent.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""

  HTTP agent logic
Severity: Minor
Found in canteen/logic/http/agent.py - About 3 hrs to fix

Function register has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def register(cls, name_or_message, response=None, **config):

      """ Internal function used to register this remote object, bound to either
          a ``name`` (if the target is a ``Service``) or a ``request`` and
          ``response`` message pair.
Severity: Minor
Found in canteen/rpc/__init__.py - About 3 hrs 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

Severity
Category
Status
Source
Language