Showing 59 of 96 total issues
Function default_namedtuple_deserializer
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def default_namedtuple_deserializer(
obj: Union[list, dict],
cls: type,
*,
key_transformer: Optional[Callable[[str], str]] = 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
File __init__.py
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Works with Python3.5+
JSON (de)serialization (jsons) from and to dicts and plain old Python objects.
File default_object.py
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
import inspect
from datetime import datetime, timezone
from inspect import isfunction
from typing import Optional, Callable, Union, MutableSequence, Tuple, Dict
Function default_object_serializer
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def default_object_serializer(
Function _do_serialize
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def _do_serialize(
Function _do_serialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _do_serialize(
obj: object,
cls: type,
attributes: Dict[str, Optional[type]],
kwargs: dict,
- 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 default_dict_serializer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def default_dict_serializer(
obj: dict,
cls: Optional[type] = None,
*,
strict: bool = False,
- 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 _fill
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _fill(
Function default_list_deserializer
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def default_list_deserializer(
Function _get_value_for_attr
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_value_for_attr(
Function default_dict_serializer
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def default_dict_serializer(
Function transform
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def transform(
Function default_iterable_serializer
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def default_iterable_serializer(
Function _start_tasks
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _start_tasks(
Function load
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def load(
Function _set_remaining_attrs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _set_remaining_attrs(instance,
remaining_attrs,
attr_getters,
**kwargs):
# Set any remaining attributes on the newly created instance.
- 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 set_serializer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_serializer(
func: callable,
cls: Union[type, Sequence[type]],
high_prio: bool = True,
fork_inst: type = StateHolder) -> 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 multi_task
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def multi_task(
Function _get_async_wrapper
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_async_wrapper(
Function _run_decorated
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _run_decorated(decorated, mapper, fork_inst, args, kwargs, mapper_kwargs):