AI Slop Code RIsk Monitor

encode/django-rest-framework

Web APIs for Django. 🎸

18.4 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for encode/django-rest-framework, a Python project with 30,200 GitHub stars. SynthScan examined 67,248 lines of code across 307 source files, recording 1100 pattern matches distributed across 18 syntactic categories. The legacy adjusted pattern signal is 18.4 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

18.4
Adjusted Signal
18.4
Raw Pattern Score
100%
Time Factor
2026-10-08
Last Push
30.2K
Stars
Python
Language
67.2K
Lines of Code
307
Files
1.1K
Pattern Hits
2026-10-12
Scan Date
0.08
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 52.5/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 1024 finding(s).

Hallucinated Dependency & Supply Chain Risk 6.8/100 · LOW

Are imports declared and package/API names verified? 30 finding(s).

Agent Over-Engineering Ratio 55.4/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 1030 finding(s).

PR Review Velocity Impact 62.2/100 · HIGH

Which changes need focused human review? 1100 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 7HIGH 18MEDIUM 28LOW 1047

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 1100 distinct pattern matches across 18 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers982 hits · 941 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_utils.py87 def test_resource_root_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py93 def test_resource_instance_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py101 def test_resource_instance_customname_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py109 def test_nested_resource_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py118 def test_nested_resource_instance_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py128 def test_broken_url_breadcrumbs_handled_gracefully(self):CODE
LOW⚡tests/test_utils.py132 def test_modelviewset_resource_instance_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py140 def test_modelviewset_list_action_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py148 def test_modelviewset_detail_action_breadcrumbs(self):CODE
LOW⚡tests/test_utils.py157 def test_modelviewset_action_name_kwarg(self):CODE
LOW⚡tests/test_utils.py166 def test_modelviewset_action_suffix_kwarg(self):CODE
LOWtests/test_utils.py207 def test_valid_unicode_preserved(self):CODE
LOWtests/test_utils.py217 def test_valid_unicode_replaced(self):CODE
LOWtests/test_utils.py239 def test_valid_unicode_removed(self):CODE
LOWtests/test_utils.py258 def test_it_formats_correctly(self):CODE
LOWtests/test_pagination.py42 def test_filtered_items_are_paginated(self):CODE
LOWtests/test_pagination.py67 def test_setting_page_size_over_maximum(self):CODE
LOWtests/test_pagination.py85 def test_setting_page_size_to_zero(self):CODE
LOWtests/test_pagination.py99 def test_additional_query_params_are_preserved(self):CODE
LOWtests/test_pagination.py110 def test_empty_query_params_are_preserved(self):CODE
LOWtests/test_pagination.py263 def test_get_paginated_response_schema(self):CODE
LOWtests/test_pagination.py407 def test_pagination_not_applied_if_limit_or_default_limit_not_set(self):CODE
LOWtests/test_pagination.py575 def test_get_paginated_response_schema(self):CODE
LOWtests/test_pagination.py619 def test_use_with_ordering_filter(self):CODE
LOWtests/test_pagination.py637 def test_use_with_ordering_filter_without_ordering_default_value(self):CODE
LOWtests/test_pagination.py724 def test_cursor_pagination_current_page_empty_forward(self):CODE
LOWtests/test_pagination.py747 def test_cursor_pagination_current_page_empty_reverse(self):CODE
LOWtests/test_pagination.py770 def test_cursor_pagination_with_page_size(self):CODE
LOWtests/test_pagination.py782 def test_cursor_pagination_with_page_size_over_limit(self):CODE
LOWtests/test_pagination.py794 def test_cursor_pagination_with_page_size_zero(self):CODE
LOWtests/test_pagination.py861 def test_cursor_pagination_with_page_size_negative(self):CODE
LOWtests/test_pagination.py928 def test_get_paginated_response_schema(self):CODE
LOWtests/test_pagination.py1105def test_get_displayed_page_numbers():CODE
LOWtests/test_relations_slug.py57 def test_foreign_key_retrieve(self):CODE
LOW⚡tests/test_relations_slug.py68 def test_foreign_key_retrieve_select_related(self):CODE
LOW⚡tests/test_relations_slug.py74 def test_reverse_foreign_key_retrieve(self):CODE
LOW⚡tests/test_relations_slug.py83 def test_reverse_foreign_key_retrieve_prefetch_related(self):CODE
LOWtests/test_relations_slug.py107 def test_foreign_key_update_incorrect_type(self):CODE
LOWtests/test_relations_slug.py114 def test_reverse_foreign_key_update(self):CODE
LOWtests/test_relations_slug.py161 def test_reverse_foreign_key_create(self):CODE
LOWtests/test_relations_slug.py179 def test_foreign_key_update_with_invalid_null(self):CODE
LOWtests/test_relations_slug.py198 def test_foreign_key_retrieve_with_null(self):CODE
LOWtests/test_relations_slug.py208 def test_foreign_key_create_with_valid_null(self):CODE
LOWtests/test_relations_slug.py227 def test_foreign_key_create_with_valid_emptystring(self):CODE
LOWtests/test_relations_slug.py251 def test_foreign_key_update_with_valid_null(self):CODE
LOWtests/test_relations_slug.py269 def test_foreign_key_update_with_valid_emptystring(self):CODE
LOWtests/conftest.py137def pytest_collection_modifyitems(config, items):CODE
LOW⚡tests/test_authtoken.py91 def test_token_string_representation(self):CODE
LOW⚡tests/test_authtoken.py94 def test_validate_raise_error_if_no_credentials_provided(self):CODE
LOW⚡tests/test_authtoken.py98 def test_whitespace_in_password(self):CODE
LOW⚡tests/test_authtoken.py104 def test_token_creation_collision_raises_integrity_error(self):CODE
LOW⚡tests/test_authtoken.py112 def test_key_generated_on_save_when_cleared(self):CODE
LOW⚡tests/test_authtoken.py125 def test_clearing_key_on_existing_token_raises_integrity_error(self):CODE
LOW⚡tests/test_authtoken.py137 def test_saving_existing_token_without_changes_does_not_alter_key(self):CODE
LOW⚡tests/test_authtoken.py143 def test_token_proxy_delete_deletes_the_token(self):CODE
LOW⚡tests/test_authtoken.py149 def test_token_proxy_delete_deletes_the_token_with_a_receiver_connected(self):CODE
LOW⚡tests/test_authtoken.py179 def test_token_proxy_queryset_delete_deletes_the_token(self):CODE
LOW⚡tests/test_authtoken.py185 def test_token_proxy_queryset_delete_leaves_other_tokens_alone(self):CODE
LOW⚡tests/test_authtoken.py193 def test_token_proxy_queryset_delete_follows_a_filter_across_a_join(self):CODE
LOW⚡tests/test_authtoken.py201 def test_token_proxy_delete_leaves_other_tokens_alone(self):CODE
922 more matches not shown…
Hallucination Indicators7 hits · 70 pts
SeverityFileLineSnippetContext
CRITICALtests/test_fields.py13from django.core.exceptions import ValidationError as DjangoValidationErrorCODE
CRITICALrest_framework/fields.py16from django.core.exceptions import ValidationError as DjangoValidationErrorCODE
CRITICALrest_framework/validators.py9from django.core.exceptions import FieldErrorCODE
CRITICALrest_framework/serializers.py23from django.core.exceptions import ValidationError as DjangoValidationErrorCODE
CRITICALrest_framework/generics.py4from django.core.exceptions import ValidationErrorCODE
CRITICALrest_framework/authtoken/admin.py5from django.core.exceptions import ValidationErrorCODE
CRITICAL…framework/static/rest_framework/js/jquery-3.7.1.min.js2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):fCODE
Empty Error Handlers13 hits · 65 pts
SeverityFileLineSnippetContext
HIGHruntests.py30except ValueError:CODE
HIGHruntests.py40except ValueError:CODE
HIGHtests/conftest.py112except ImportError:CODE
HIGHrest_framework/metadata.py87except (exceptions.APIException, PermissionDenied, Http404):CODE
HIGHrest_framework/fields.py1262except (ValueError, TypeError):CODE
HIGHrest_framework/fields.py1270except (ValueError, TypeError):CODE
HIGHrest_framework/fields.py1325except (ValueError, TypeError):CODE
HIGHrest_framework/fields.py1333except (ValueError, TypeError):CODE
HIGHrest_framework/viewsets.py212except NoReverseMatch:CODE
HIGHrest_framework/serializers.py520except SkipField:CODE
HIGHrest_framework/test.py166except AttributeError:CODE
HIGHrest_framework/negotiation.py138except Exception:CODE
HIGHrest_framework/utils/breadcrumbs.py19except Exception:CODE
Decorative Section Separators21 hits · 54 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_model_serializer.py39# ---------------------------------COMMENT
MEDIUMtests/test_model_serializer.py603# ------------------------------------STRING
MEDIUMtests/test_serializer.py22# -------------------------------COMMENT
MEDIUMtests/test_serializer.py62# -----------------------------COMMENT
MEDIUMtests/test_validators.py22# ---------------------------COMMENT
MEDIUMtests/test_validators.py222# -----------------------------------STRING
MEDIUMtests/test_validators.py1281# ----------------------------------STRING
MEDIUMtests/test_validators.py1388# ----------------------------------STRING
MEDIUMtests/test_validators.py1427# ----------------------------------STRING
MEDIUMtests/test_validators.py1554# ---------------------------------STRING
MEDIUM⚡tests/test_fields.py2797# --------------------COMMENT
MEDIUM⚡tests/test_fields.py2814# --------------------COMMENT
MEDIUMtests/test_fields.py31# ---------------------------COMMENT
MEDIUMtests/test_fields.py126# ---------------------------------------------------------COMMENT
MEDIUMtests/test_fields.py700# ----------------------------------------COMMENT
MEDIUMtests/test_fields.py2829# --------------------------------COMMENT
MEDIUMtests/test_fields.py2855# ---------------------COMMENT
MEDIUMtests/test_fields.py2867# ---------------------------COMMENT
MEDIUMrest_framework/serializers.py87# --------------COMMENT
MEDIUMrest_framework/serializers.py274# -----------------------------------COMMENT
MEDIUMrest_framework/serializers.py835# --------------------------------------------COMMENT
Deep Nesting26 hits · 24 pts
SeverityFileLineSnippetContext
LOWtests/test_views.py29CODE
LOWrest_framework/fields.py161CODE
LOWrest_framework/fields.py695CODE
LOWrest_framework/fields.py833CODE
LOWrest_framework/fields.py1194CODE
LOWrest_framework/fields.py1249CODE
LOWrest_framework/fields.py1315CODE
LOWrest_framework/serializers.py1266CODE
LOWrest_framework/serializers.py1464CODE
LOWrest_framework/serializers.py1503CODE
LOWrest_framework/renderers.py179CODE
LOWrest_framework/renderers.py558CODE
LOWrest_framework/renderers.py778CODE
LOWrest_framework/routers.py266CODE
LOWrest_framework/filters.py20CODE
LOWrest_framework/filters.py84CODE
LOWrest_framework/filters.py112CODE
LOWrest_framework/negotiation.py43CODE
LOWrest_framework/templatetags/rest_framework.py182CODE
LOWrest_framework/utils/encoders.py23CODE
LOWrest_framework/utils/representation.py70CODE
LOWrest_framework/schemas/openapi.py215CODE
LOWrest_framework/schemas/openapi.py269CODE
LOWrest_framework/schemas/openapi.py338CODE
LOWrest_framework/schemas/openapi.py561CODE
LOWrest_framework/schemas/generators.py72CODE
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHtests/test_relations_slug.py0the emptystring should be interpreted as null in the context of relationships.STRING
HIGHtests/test_relations_hyperlink.py0the emptystring should be interpreted as null in the context of relationships.STRING
HIGHtests/test_relations_pk.py0the emptystring should be interpreted as null in the context of relationships.STRING
Self-Referential Comments5 hits · 14 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/test_authtoken.py113 # Create a new user for this test to avoid conflicts with setUp tokenCOMMENT
MEDIUM⚡tests/test_authtoken.py116 # Create a token without a key - it should generate one automaticallyCOMMENT
MEDIUMtests/test_model_serializer.py941 # Creating the instance, relationship attributes should be set.STRING
MEDIUMtests/test_model_serializer.py989 # Creating the instance, relationship attributes should be set.STRING
MEDIUMrest_framework/serializers.py1150 # Create the serializer field.COMMENT
Unused Imports15 hits · 14 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py111CODE
LOWtests/importable/__init__.py6CODE
LOWrest_framework/compat.py145CODE
LOWrest_framework/serializers.py55CODE
LOWrest_framework/serializers.py55CODE
LOWrest_framework/serializers.py55CODE
LOWrest_framework/serializers.py55CODE
LOWrest_framework/serializers.py62CODE
LOWrest_framework/serializers.py62CODE
LOWrest_framework/serializers.py62CODE
LOWrest_framework/serializers.py68CODE
LOWrest_framework/serializers.py71CODE
LOWrest_framework/apps.py10CODE
LOWrest_framework/schemas/__init__.py25CODE
LOWrest_framework/schemas/__init__.py26CODE
Excessive Try-Catch Wrapping9 hits · 9 pts
SeverityFileLineSnippetContext
LOWtests/test_urlpatterns.py27 except Exception:CODE
LOWtests/test_urlpatterns.py43 except Exception:CODE
LOWrest_framework/request.py368 except Exception:CODE
LOWrest_framework/renderers.py199 except Exception:CODE
LOWrest_framework/negotiation.py138 except Exception:CODE
LOWrest_framework/views.py316 except Exception:CODE
LOWrest_framework/views.py525 except Exception as exc:CODE
LOWrest_framework/utils/breadcrumbs.py19 except Exception:CODE
LOWrest_framework/schemas/openapi.py284 except Exception:CODE
Fake / Example Data7 hits · 6 pts
SeverityFileLineSnippetContext
LOWREADME.md132 "email": "admin@example.com",CODE
LOWtests/schemas/test_openapi.py1105 assert properties['email']['default'] == 'foo@bar.com'CODE
LOWtests/schemas/views.py131 email = serializers.EmailField(default='foo@bar.com')CODE
LOWdocs/tutorial/quickstart.md229 "email": "admin@example.com",CODE
LOWdocs/tutorial/quickstart.md249 "email": "admin@example.com",CODE
LOWdocs/topics/html-and-forms.md111 style={'placeholder': 'Email', 'autofocus': True}CODE
LOWdocs/topics/html-and-forms.md115 style={'input_type': 'password', 'placeholder': 'Password'}CODE
Modern AI Meta-Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMrest_framework/relations.py291 # We include this simply for dependency injection in tests.COMMENT
MEDIUMrest_framework/views.py117 # Allow dependency injection of other settings to make testing easier.COMMENT
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHtests/test_fields.py2781 (b'{"a": 1, "3": null, "b": ["some", "list", true, 1.23]}', {CODE
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHdocs/tutorial/2-requests-and-responses.md20return Response(data) # Renders to content type as requested by the client.CODE
Redundant / Tautological Comments3 hits · 4 pts
SeverityFileLineSnippetContext
LOWrest_framework/settings.py223 # Check if present in user settingsCOMMENT
LOWrest_framework/decorators.py97 # Check if func is actually a view function (result of APIView.as_view())COMMENT
LOWrest_framework/utils/breadcrumbs.py22 # Check if this is a REST framework view,COMMENT
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWrest_framework/fields.py294CODE
LOWrest_framework/schemas/__init__.py29CODE
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWrest_framework/serializers.py1678 # Note that we make sure to check `unique_together` both on theCOMMENT
Over-Commented Block1 hit · 1 pts
SeverityFileLineSnippetContext
LOWrest_framework/serializers.py881 method_name=method_name,COMMENT
Overly Generic Function Names1 hit · 0 pts
SeverityFileLineSnippetContext
LOWtests/test_fields.py68 def test_function(self):CODE