Showing 2,141 of 2,141 total issues
File __init__.py
has 2385 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import datetime
import decimal
import operator
import uuid
File query.py
has 2194 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
File query.py
has 2183 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
File options.py
has 2134 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import enum
import json
import re
from functools import partial, update_wrapper
File base.py
has 2069 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import inspect
import warnings
from collections import defaultdict
from functools import partialmethod
File compiler.py
has 1826 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import json
import re
from functools import partial
from itertools import chain
File related.py
has 1737 lines of code (exceeds 250 allowed). Consider refactoring. Open
import functools
import inspect
from functools import partial
from django import forms
File autodetector.py
has 1730 lines of code (exceeds 250 allowed). Consider refactoring. Open
import functools
import re
from collections import defaultdict, namedtuple
from enum import Enum
from graphlib import TopologicalSorter
File schema.py
has 1727 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import operator
from datetime import datetime
from django.conf import settings
File expressions.py
has 1705 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import datetime
import functools
import inspect
from collections import defaultdict
Function templatize
has a Cognitive Complexity of 195 (exceeds 5 allowed). Consider refactoring. Open
def templatize(src, origin=None):
"""
Turn a Django template into something that is understood by xgettext. It
does so by translating the Django translation tags into standard gettext
function invocations.
- 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 models.py
has 1343 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Helper functions for creating Form classes from Django models
and database field objects.
"""
File checks.py
has 1220 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
from itertools import chain
from django.apps import apps
from django.conf import settings
File related_descriptors.py
has 1195 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Accessors for related objects.
When a field defines a relation between two models, each model class provides
an attribute to access related instances of the other model class (unless the
File defaulttags.py
has 1194 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Default tags used by the template system, available to all templates."""
import re
import sys
import warnings
File fields.py
has 1121 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Field classes.
"""
import copy
File models.py
has 1057 lines of code (exceeds 250 allowed). Consider refactoring. Open
from copy import copy
from django.db import models
from django.db.migrations.operations.base import Operation, OperationCategory
from django.db.migrations.state import ModelState
Function __new__
has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring. Open
def __new__(cls, name, bases, attrs, **kwargs):
super_new = super().__new__
# Also ensure initialization is only performed for subclasses of Model
# (excluding Model class itself).
- 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 widgets.py
has 1025 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
HTML Widget classes
"""
import copy
Function handle
has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **options):
database = options["database"]
self.verbosity = options["verbosity"]
self.interactive = options["interactive"]
- 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"