Showing 38 of 86 total issues
File model.py
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""byte - model module."""
from __future__ import absolute_import, division, print_function
Expressions
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Expressions(object):
"""Expressions class."""
def and_(self, *values):
"""Create and expression."""
File property.py
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""byte - property module."""
from __future__ import absolute_import, division, print_function
File manager.py
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""byte - plugin manager module."""
from __future__ import absolute_import, division, print_function
from byte import __path__ as byte_path
Collection
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Collection(object):
"""Collection for the storage of keyed items."""
def __init__(self, model_or_uri=None, uri=None, model=None, executor=None, plugins=None, **kwargs):
"""
Function update
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def update(self, modules=None, reset=True):
"""Update plugins registry.
:param modules: Modules to scan for plugins
:type modules: list of module
- 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 order_by
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def order_by(self, *properties):
"""Order results by :code:`properties`."""
if 'order_by' not in self.state:
self.state['order_by'] = []
- 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 index_insertions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def index_insertions(self, primary_key):
"""Index insertion operations by primary key."""
insertions = {}
for operation in self.operations:
- 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 discover
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def discover(cls, packages=('compilers', 'executors', 'formats')):
"""Discover plugin modules.
:param packages: Package names
:type packages: tuple of str
- 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 __construct_expression
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __construct_expression(self, expressions, op, left, right):
if op in ['eq', '=', '==']:
return ProxyEqual(left, right)
if op in ['ne', '!=']:
- 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 __parse_string_parts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __parse_string_parts(self, parts, offset=0, parameters=None):
if (len(parts) - 1) % 2 > 0:
raise ValueError('Incorrect number of expression parts')
if parts[0] == '(' and parts[-1] == ')':
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, value_type, by=None, default=None, max_length=None, name=None, nullable=False,
Function __create_init
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __create_init(bases, namespace, properties):
original = namespace.get('__init__')
def __init__(self, *args, **kwargs):
self.__collection__ = kwargs.pop('_collection', None)
- 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 from_plain
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def from_plain(cls, data, strict=True, translate=False):
"""
Parse model item from plain dictionary.
:param data: Item data
- 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 is_tuple_of
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def is_tuple_of(items, value_type):
"""Validate tuple :code:`items` match :code:`value_type`.
:param items: Items
:type items: tuple
- 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 register_collections
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def register_collections(self, plugin, meta):
"""Register plugin in collections.
:param plugin: Plugin
:param meta: Plugin metadata
- 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, collection, model, items=None, properties=None, query=None, state=None):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, model_or_uri=None, uri=None, model=None, executor=None, plugins=None, **kwargs):
Function __parse_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __parse_string(self, value, *parameters):
if not value:
return []
if len(parameters) == 1 and type(parameters[0]) is tuple:
- 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 discover_package
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def discover_package(package, package_path):
"""Discover plugin modules in package.
:param package: Package name
:type package: str
- 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"