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
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 __extract_properties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __extract_properties(cls, namespace, remove=True):
if not namespace:
return
# Iterate over items in `namespace`
- 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 __decode_property
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __decode_property(prop, value, strict=True, translate=False):
# Try decode property value
try:
value = prop.decode(
value,
- 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"