Showing 43 of 53 total issues
File queryset.py
has 1055 lines of code (exceeds 500 allowed). Consider refactoring. Open
import asyncio
from typing import (
TYPE_CHECKING,
Any,
AsyncGenerator,
File newbasemodel.py
has 1026 lines of code (exceeds 500 allowed). Consider refactoring. Open
import base64
import sys
import warnings
from typing import (
TYPE_CHECKING,
File querysetproxy.py
has 714 lines of code (exceeds 500 allowed). Consider refactoring. Open
from _weakref import CallableProxyType
from typing import ( # noqa: I100, I201
TYPE_CHECKING,
Any,
AsyncGenerator,
File model_fields.py
has 660 lines of code (exceeds 500 allowed). Consider refactoring. Open
import datetime
import decimal
import uuid
from enum import Enum as E
from enum import EnumMeta
File metaclass.py
has 635 lines of code (exceeds 500 allowed). Consider refactoring. Open
import copy
import sys
import warnings
from pathlib import Path
from typing import (
File prefetch_query.py
has 503 lines of code (exceeds 500 allowed). Consider refactoring. Open
import abc
import logging
from abc import abstractmethod
from typing import (
TYPE_CHECKING,
Function __init__
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, **kwargs: Any) -> None:
self.__type__: type = kwargs.pop("__type__", None)
self.__pydantic_type__: type = kwargs.pop("__pydantic_type__", None)
self.__sample__: type = kwargs.pop("__sample__", None)
self.related_name = kwargs.pop("related_name", None)
Function substitute_models_with_pks
has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring. Open
def substitute_models_with_pks(cls, model_dict: Dict) -> Dict: # noqa CCR001
"""
Receives dictionary of model that is about to be saved and changes all related
models that are stored as foreign keys to their fk 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"
Further reading
Function _extract_nested_models
has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring. 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 subtract_dict
has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring. Open
def subtract_dict(current_dict: Any, updating_dict: Any) -> Dict: # noqa: CCR001
"""
Update one dict with another but with regard for nested keys.
That way nested sets are unionised, dicts updated and
- 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 14 arguments (exceeds 6 allowed). Consider refactoring. Open
def __init__( # noqa: CFQ002
Function dict
has 13 arguments (exceeds 6 allowed). Consider refactoring. Open
def dict( # type: ignore # noqa A003
Function __init__
has 12 arguments (exceeds 6 allowed). Consider refactoring. Open
def __init__( # noqa CFQ002
Function json
has 12 arguments (exceeds 6 allowed). Consider refactoring. Open
def json( # type: ignore # noqa A003
Function rebuild_self
has 11 arguments (exceeds 6 allowed). Consider refactoring. Open
def rebuild_self( # noqa: CFQ002
Function ForeignKey
has 11 arguments (exceeds 6 allowed). Consider refactoring. Open
def ForeignKey( # type: ignore # noqa CFQ002
Function from_row
has 10 arguments (exceeds 6 allowed). Consider refactoring. Open
def from_row( # noqa: CFQ002
Function _populate_nested_models_from_row
has 10 arguments (exceeds 6 allowed). Consider refactoring. Open
def _populate_nested_models_from_row( # noqa: CFQ002
Function __new__
has 10 arguments (exceeds 6 allowed). Consider refactoring. Open
def __new__( # type: ignore # noqa CFQ002
Function __init__
has 10 arguments (exceeds 6 allowed). Consider refactoring. Open
def __init__( # noqa CFQ002