ormar/models/newbasemodel.py
File newbasemodel.py
has 1026 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
import base64
import sys
import warnings
from typing import (
TYPE_CHECKING,
Function model_dump
has 16 arguments (exceeds 6 allowed). Consider refactoring. Invalid
Invalid
def model_dump( # type: ignore # noqa A003
Function _extract_nested_models
has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring. Open
Open
def _extract_nested_models( # noqa: CCR001, CFQ002
self,
relation_map: Dict,
dict_instance: Dict,
include: Optional[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 dict
has 13 arguments (exceeds 6 allowed). Consider refactoring. Open
Open
def dict( # type: ignore # noqa A003
Function model_dump_json
has 12 arguments (exceeds 6 allowed). Consider refactoring. Invalid
Invalid
def model_dump_json( # type: ignore # noqa A003
Function json
has 12 arguments (exceeds 6 allowed). Consider refactoring. Open
Open
def json( # type: ignore # noqa A003
Function _extract_nested_models
has 9 arguments (exceeds 6 allowed). Consider refactoring. Open
Open
def _extract_nested_models( # noqa: CCR001, CFQ002