encode/django-rest-framework
337 findings in 74 Python files · 15,716 lines · scanned in 19.6 s on 2026-11-12
Every number here comes from the same analyzer that runs on your upload, on the tree as it is in the repository. A finding is listed with the function or module it sits in; nothing is matched from text. Tests, examples and benchmarks are excluded from the scan, so "never referenced inside the project" means exactly that.
swallowed_error 2
an except that hides what went wrong
rest_framework.negotiation.DefaultContentNegotiation._get_parsed_accept_listexception caught at line(s) 138 and dropped silently — log it or re-raise, or the failure never reaches anyone - reachable from 1 call site (rest_framework/negotiation.py:55)rest_framework.utils.breadcrumbs.get_breadcrumbs.<locals>.breadcrumbs_recursiveexception caught at line(s) 19 and dropped silently — log it or re-raise, or the failure never reaches anyone
god_class 2
a class that owns too much
rest_framework.schemas.openapi.AutoSchema27 methods — likely does too muchrest_framework.views.APIView33 methods — likely does too much
wide_signature 18
functions that take so many arguments the call sites are unreadable
rest_framework.fields.DecimalField.__init__9 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 55 call sites (rest_framework/exceptions.py:202, rest_framework/exceptions.py:212, rest_framework/exceptions.py:223)rest_framework.fields.FilePathField.__init__7 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 55 call sites (rest_framework/exceptions.py:202, rest_framework/exceptions.py:212, rest_framework/exceptions.py:223)rest_framework.response.Response.__init__6 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 55 call sites (rest_framework/exceptions.py:202, rest_framework/exceptions.py:212, rest_framework/exceptions.py:223)rest_framework.reverse.reverse6 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 12 call sites (rest_framework/authtoken/admin.py:18, rest_framework/relations.py:334, rest_framework/reverse.py:41)rest_framework.reverse._reverse6 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 3 call sites (rest_framework/reverse.py:45, rest_framework/reverse.py:47, rest_framework/versioning.py:25)rest_framework.schemas.get_schema_view11 parameters — a call site says nothing about them; group them into one object or split the function
and 12 more of the same check.
complex 13
branchy functions, counted from the AST
rest_framework.schemas.openapi.AutoSchema.map_fieldcyclomatic complexity 32rest_framework.utils.field_mapping.get_field_kwargscyclomatic complexity 58rest_framework.fields.Field.__init__cyclomatic complexity 18rest_framework.pagination.CursorPagination.paginate_querysetcyclomatic complexity 17rest_framework.renderers.BrowsableAPIRenderer.get_rendered_html_formcyclomatic complexity 20rest_framework.schemas.openapi.AutoSchema.map_field_validatorscyclomatic complexity 17
and 7 more of the same check.
duplicate 9
the same block in two places
rest_framework.fields.FloatField.__init__Identical code in 2 functions (rest_framework.fields.FloatField.__init__, rest_framework.fields.IntegerField.__init__) — extract it into one function and call it from eachrest_framework.fields.DateField.__init__Identical code in 2 functions (rest_framework.fields.DateField.__init__, rest_framework.fields.TimeField.__init__) — extract it into one function and call it from eachrest_framework.pagination.CursorPagination.get_page_sizeIdentical code in 2 functions (rest_framework.pagination.CursorPagination.get_page_size, rest_framework.pagination.PageNumberPagination.get_page_size) — extract it into one function and call it from eachrest_framework.relations.RelatedField.__new__Identical code in 2 functions (rest_framework.relations.RelatedField.__new__, rest_framework.serializers.BaseSerializer.__new__) — extract it into one function and call it from eachrest_framework.relations.ManyRelatedField.iter_optionsIdentical code in 2 functions (rest_framework.relations.ManyRelatedField.iter_options, rest_framework.relations.RelatedField.iter_options) — extract it into one function and call it from eachrest_framework.serializers.ListSerializer.run_validationIdentical code in 2 functions (rest_framework.serializers.ListSerializer.run_validation, rest_framework.serializers.Serializer.run_validation) — extract it into one function and call it from each
and 3 more of the same check.
hub 1
a module everything depends on
rest_framework.fields.Field.failcalled from 25 places — change here ripples widely
large_module 2
a check from the analyzer
rest_framework.fields1984 linesrest_framework.serializers1799 lines
unused 29
never called, never imported, never read
rest_framework.apps.RestFrameworkConfig.readynever referenced inside the project (dead code or public API)rest_framework.authentication.CSRFCheck._rejectnever referenced inside the project (dead code or public API)rest_framework.authtoken.admin.TokenChangeList.url_for_resultnever referenced inside the project (dead code or public API)rest_framework.authtoken.admin.TokenAdmin.get_changelistnever referenced inside the project (dead code or public API)rest_framework.authtoken.management.commands.drf_create_token.Command.add_argumentsnever referenced inside the project (dead code or public API)rest_framework.authtoken.management.commands.drf_create_token.Command.handlenever referenced inside the project (dead code or public API)
and 23 more of the same check.
bad_name 2
a name that does not say what the thing holds
rest_framework.authtoken.models.TokenProxy.pknames say nothing (pk) — rename to what they holdrest_framework.relations.Hyperlink.__new__names say nothing (obj, ret) — rename to what they hold
no_contract 259
a function whose docstring promises nothing
rest_framework.authentication.TokenAuthentication.get_modelno docstring and no type hints — what it takes and returns is only visible by reading the bodyrest_framework.authentication.TokenAuthentication.authenticateno docstring and no type hints — what it takes and returns is only visible by reading the bodyrest_framework.authentication.TokenAuthentication.authenticate_credentialsno docstring and no type hints — what it takes and returns is only visible by reading the bodyrest_framework.authentication.RemoteUserAuthentication.authenticateno docstring and no type hints — what it takes and returns is only visible by reading the bodyrest_framework.authtoken.admin.TokenChangeList.url_for_resultno docstring and no type hints — what it takes and returns is only visible by reading the bodyrest_framework.authtoken.management.commands.drf_create_token.Command.create_user_tokenno docstring and no type hints — what it takes and returns is only visible by reading the body
and 253 more of the same check.
Five projects free. A .zip or a public GitHub URL.
Other repositories, same treatment
- Textualize/rich 97 findings
- celery/celery 1052 findings
- encode/httpx 26 findings
- fastapi/fastapi 163 findings
- pallets/click 85 findings
- pallets/flask 45 findings
- psf/requests 47 findings
- pydantic/pydantic 164 findings
- scrapy/scrapy 186 findings