AI Slop Code RIsk Monitor

vitalik/django-ninja

💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

13.1 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for vitalik/django-ninja, a Python project with 9,207 GitHub stars. SynthScan examined 40,697 lines of code across 255 source files, recording 482 pattern matches distributed across 15 syntactic categories. The legacy adjusted pattern signal is 13.1 (Moderate 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.

13.1
Adjusted Signal
13.1
Raw Pattern Score
100%
Time Factor
2026-10-05
Last Push
9.2K
Stars
Python
Language
40.7K
Lines of Code
255
Files
482
Pattern Hits
2026-10-12
Scan Date
0.02
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 39.3/100 · MEDIUM

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

Hallucinated Dependency & Supply Chain Risk 9.3/100 · LOW

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

Agent Over-Engineering Ratio 38.9/100 · MEDIUM

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

PR Review Velocity Impact 47.7/100 · MEDIUM

Which changes need focused human review? 482 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 3HIGH 1MEDIUM 7LOW 471

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 482 distinct pattern matches across 15 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 Identifiers314 hits · 324 pts
SeverityFileLineSnippetContext
LOWtests/test_csrf.py71def obtain_csrf_token_get_no_auth_route(request):CODE
LOWtests/test_csrf.py78def obtain_csrf_token_post_no_auth_route(request):CODE
LOWtests/test_csrf.py145def test_csrf_cookies_can_be_obtained():CODE
LOWtests/test_filter_schema.py33def test_annotated_without_filter_lookup():CODE
LOWtests/test_filter_schema.py44def test_improperly_configured_deprecated():CODE
LOWtests/test_filter_schema.py55def test_improperly_configured_annotated():CODE
LOWtests/test_filter_schema.py66def test_empty_q_when_none_ignored_deprecated():CODE
LOWtests/test_filter_schema.py78def test_empty_q_when_none_ignored_annotated():CODE
LOWtests/test_filter_schema.py149def test_q_is_a_list_deprecated(implicit_field_name):CODE
LOWtests/test_filter_schema.py168def test_q_is_a_list_annotated(implicit_field_name):CODE
LOWtests/test_filter_schema.py188def test_field_level_expression_connector_deprecated():CODE
LOWtests/test_filter_schema.py205def test_field_level_expression_connector_annotated():CODE
LOWtests/test_filter_schema.py225def test_class_level_expression_connector_deprecated():CODE
LOWtests/test_filter_schema.py239def test_class_level_expression_connector_annotated():CODE
LOWtests/test_filter_schema.py253def test_class_level_and_field_level_expression_connector_deprecated():CODE
LOWtests/test_filter_schema.py272def test_class_level_and_field_level_expression_connector_annotated():CODE
LOWtests/test_filter_schema.py294def test_ignore_none_deprecated():CODE
LOWtests/test_filter_schema.py305def test_ignore_none_annotated():CODE
LOWtests/test_filter_schema.py316def test_ignore_none_class_level_deprecated():CODE
LOWtests/test_filter_schema.py330def test_ignore_none_class_level_annotated():CODE
LOWtests/test_filter_schema.py344def test_field_level_custom_expression():CODE
LOWtests/test_filter_schema.py367def test_class_level_custom_expression():CODE
LOWtests/test_filter_schema.py393def test_multiple_filter_lookup_instances_error():CODE
LOWtests/test_filter_schema.py406def test_pydantic_field_with_extra_warns():CODE
LOWtests/test_export_openapi_schema.py50def test_export_default_without_api_endpoint(mock):CODE
LOWtests/test_inheritance_routers.py86def test_inheritance_responses(path, expected_status, expected_response):CODE
LOWtests/test_utils.py18def test_replace_path_param_notation(input, expected_output):CODE
LOWtests/test_utils.py22def test_contribute_operation_args():CODE
LOWtests/test_pagination.py620def test_limit_offset_per_endpoint_max_limit():CODE
LOWtests/test_pagination.py667def test_pagination_works_with_unnamed_classes():CODE
LOWtests/test_pagination.py680def test_no_pagination_without_query_params():CODE
LOWtests/test_pagination.py707def test_find_collection_response_skips_none_and_not_set():CODE
LOWtests/test_pagination.py730def test_find_collection_response_raises_when_no_collection():CODE
LOWtests/test_body.py59def test_body_validation_error():CODE
LOWtests/test_body.py75def test_incorrect_annotation():CODE
LOWtests/test_body.py90 def validation_error_from_error_contexts(CODE
LOWtests/test_body.py118def test_body_custom_validation_error():CODE
LOWtests/test_response.py202def test_pydantic_httpurl_schema():CODE
LOWtests/test_annotations_py314.py38def test_paginated_route_with_deferred_annotations():CODE
LOWtests/test_annotations_py314.py56def test_schema_with_self_referencing_resolver_annotation():CODE
LOWtests/test_compatibility.py14def test_modelschema_custom_annotation():CODE
LOWtests/test_compatibility.py34def test_modelschema_fk_schema_annotation():CODE
LOWtests/test_openapi_schema.py165def method_union_payload_and_simple(request, data: Union[int, TypeB]):CODE
LOWtests/test_openapi_schema.py183def method_test_title_description(CODE
LOWtests/test_openapi_schema.py193def method_test_deprecated_example_examples(CODE
LOWtests/test_openapi_schema.py698def test_schema_title_description(schema):CODE
LOWtests/test_openapi_schema.py758def test_schema_deprecated_example_examples(schema):CODE
LOWtests/test_openapi_schema.py836def test_union_payload_simple(schema):CODE
LOWtests/test_openapi_schema.py860def test_new_union_payload_type(schema):CODE
LOWtests/test_openapi_schema.py895def test_unique_operation_ids(capsys):CODE
LOWtests/test_openapi_schema.py982def test_all_paths_typed_params_rendered():CODE
LOWtests/test_openapi_schema.py1012def test_no_default_for_custom_items_attribute():CODE
LOWtests/test_openapi_schema.py1047def test_by_alias_uses_serialization_alias_simple():CODE
LOWtests/test_openapi_schema.py1072def test_by_alias_uses_validation_alias_simple():CODE
LOWtests/test_openapi_schema.py1098def test_by_alias_uses_serialization_alias_model():CODE
LOWtests/test_forms_and_files.py71def test_empty_multipart_body_field():CODE
LOWtests/test_pydantic_migrate.py23def test_optional_pydantic_model():CODE
LOWtests/test_orm_schemas.py376def test_textfield_max_length_validates_input_only():CODE
LOWtests/test_orm_schemas.py405def test_textfield_max_length_api_flow():CODE
LOWtests/test_orm_schemas.py603def test_duplicate_schema_names():CODE
254 more matches not shown…
Unused Imports53 hits · 48 pts
SeverityFileLineSnippetContext
LOWninja/__init__.py5CODE
LOWninja/__init__.py7CODE
LOWninja/__init__.py8CODE
LOWninja/__init__.py8CODE
LOWninja/__init__.py8CODE
LOWninja/__init__.py9CODE
LOWninja/__init__.py10CODE
LOWninja/__init__.py10CODE
LOWninja/__init__.py11CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py12CODE
LOWninja/__init__.py29CODE
LOWninja/__init__.py30CODE
LOWninja/__init__.py31CODE
LOWninja/__init__.py32CODE
LOWninja/__init__.py33CODE
LOWninja/__init__.py33CODE
LOWninja/errors.py13CODE
LOWninja/errors.py14CODE
LOWninja/router.py30CODE
LOWninja/webhooks.py9CODE
LOWninja/main.py39CODE
LOWninja/signature/__init__.py1CODE
LOWninja/signature/__init__.py2CODE
LOWninja/security/__init__.py1CODE
LOWninja/security/__init__.py1CODE
LOWninja/security/__init__.py1CODE
LOWninja/security/__init__.py2CODE
LOWninja/security/__init__.py2CODE
LOWninja/openapi/__init__.py1CODE
LOWninja/openapi/docs.py16CODE
LOWninja/openapi/urls.py9CODE
LOWninja/openapi/views.py10CODE
LOWninja/openapi/schema.py29CODE
LOWninja/testing/__init__.py1CODE
LOWninja/testing/__init__.py1CODE
LOWninja/params/models.py24CODE
LOWninja/orm/__init__.py1CODE
LOWninja/orm/__init__.py2CODE
LOWninja/orm/__init__.py3CODE
Modern Structural Boilerplate35 hits · 36 pts
SeverityFileLineSnippetContext
LOWninja/files.py6__all__ = ["UploadedFile"]CODE
LOWninja/responses.py10__all__ = [CODE
LOWninja/constants.py3__all__ = ["NOT_SET"]CODE
LOWninja/__init__.py35__all__ = [CODE
LOWninja/renderers.py8__all__ = ["BaseRenderer", "JSONRenderer"]CODE
LOWninja/types.py5__all__ = ["DictStrAny", "TCallable", "TSchemaClass"]CODE
LOWninja/operation.py51__all__ = ["Operation", "PathView", "ResponseObject"]CODE
LOWninja/parser.py9__all__ = ["Parser"]CODE
LOWninja/utils.py7__all__ = [CODE
LOWninja/errors.py16__all__ = [CODE
LOWninja/errors.py87def set_default_exc_handlers(api: "NinjaAPI") -> None:CODE
LOWninja/router.py33__all__ = ["Router", "RouterMount", "BoundRouter"]CODE
LOWninja/webhooks.py11__all__ = ["Webhook", "get_webhooks"]CODE
LOWninja/streaming.py8__all__ = ["StreamFormat", "SSE", "JSONL"]CODE
LOWninja/main.py41__all__ = ["NinjaAPI"]CODE
LOW⚡ninja/main.py664 def set_default_exception_handlers(self) -> None:CODE
LOWninja/schema.py48__all__ = ["BaseModel", "Field", "DjangoGetter", "Schema"]CODE
LOWninja/compatibility/util.py4__all__ = ["UNION_TYPES", "get_annotations_from_namespace"]CODE
LOWninja/signature/__init__.py4__all__ = ["ViewSignature", "is_async"]CODE
LOWninja/signature/details.py30__all__ = [CODE
LOWninja/signature/utils.py13__all__ = [CODE
LOWninja/security/session.py8__all__ = ["SessionAuth", "SessionAuthSuperUser", "SessionAuthIsStaff"]CODE
LOWninja/security/__init__.py5__all__ = [CODE
LOWninja/security/http.py11__all__ = ["HttpAuthBase", "HttpBearer", "DecodeError", "HttpBasicAuth"]CODE
LOWninja/security/apikey.py10__all__ = ["APIKeyBase", "APIKeyQuery", "APIKeyCookie", "APIKeyHeader"]CODE
LOWninja/security/base.py9__all__ = ["SecuritySchema", "AuthBase"]CODE
LOWninja/openapi/__init__.py3__all__ = ["get_schema"]CODE
LOWninja/openapi/urls.py11__all__ = ["get_openapi_urls", "get_root_url"]CODE
LOWninja/testing/__init__.py3__all__ = ["TestClient", "TestAsyncClient"]CODE
LOWninja/params/models.py26__all__ = [CODE
LOWninja/params/__init__.py7__all__ = [CODE
LOWninja/orm/fields.py17__all__ = ["create_m2m_link_type", "get_schema_field", "get_related_field_schema"]CODE
LOWninja/orm/shortcuts.py6__all__ = ["S", "L"]CODE
LOWninja/orm/__init__.py5__all__ = ["create_schema", "register_field", "ModelSchema"]CODE
LOWninja/orm/factory.py25__all__ = ["SchemaFactory", "factory", "create_schema"]CODE
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippetContext
CRITICALdocs/docs/tutorial/part-4.md192from django.core.exceptions import ValidationErrorCODE
CRITICALdocs/docs/tutorial/part-8.md288from django.core.exceptions import ValidationErrorCODE
CRITICALninja/static/ninja/redoc.standalone.js41`;class As extends n.PureComponent{render(){return n.createElement("div",{style:{textAlign:"center"}},n.createElement(_sCODE
AI Structural Patterns30 hits · 30 pts
SeverityFileLineSnippetContext
LOWninja/operation.py67CODE
LOWninja/operation.py586CODE
LOWninja/router.py234CODE
LOWninja/router.py274CODE
LOWninja/router.py314CODE
LOWninja/router.py354CODE
LOWninja/router.py394CODE
LOWninja/router.py434CODE
LOWninja/router.py480CODE
LOWninja/router.py583CODE
LOWninja/router.py597CODE
LOWninja/webhooks.py22CODE
LOWninja/main.py53CODE
LOWninja/main.py124CODE
LOWninja/main.py167CODE
LOWninja/main.py210CODE
LOWninja/main.py253CODE
LOWninja/main.py296CODE
LOWninja/main.py339CODE
LOWninja/main.py384CODE
LOWninja/main.py398CODE
LOWninja/params/functions.py11CODE
LOWninja/params/functions.py50CODE
LOWninja/params/functions.py89CODE
LOWninja/params/functions.py128CODE
LOWninja/params/functions.py167CODE
LOWninja/params/functions.py206CODE
LOWninja/params/functions.py245CODE
LOWninja/params/models.py198CODE
LOWninja/params/__init__.py77CODE
Deep Nesting19 hits · 19 pts
SeverityFileLineSnippetContext
LOWninja/filter_schema.py155CODE
LOWninja/operation.py324CODE
LOWninja/operation.py560CODE
LOWninja/router.py118CODE
LOWninja/router.py172CODE
LOWninja/router.py754CODE
LOWninja/webhooks.py57CODE
LOWninja/main.py522CODE
LOWninja/schema.py61CODE
LOWninja/signature/details.py356CODE
LOWninja/signature/details.py126CODE
LOWninja/signature/details.py187CODE
LOWninja/signature/details.py221CODE
LOWninja/management/utils.py7CODE
LOWninja/openapi/schema.py408CODE
LOWninja/openapi/schema.py78CODE
LOWninja/openapi/schema.py221CODE
LOWninja/testing/client.py144CODE
LOWninja/orm/metaclass.py68CODE
Self-Referential Comments4 hits · 12 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_csrf_async.py75 # Define the async function and manually set csrf_exempt attributeCOMMENT
MEDIUMninja/operation.py659 # Create a unique view function for this PathViewCOMMENT
MEDIUMninja/operation.py662 # Create a wrapper for async viewCOMMENT
MEDIUMninja/operation.py674 # Create a wrapper for sync viewCOMMENT
AI Slop Vocabulary4 hits · 10 pts
SeverityFileLineSnippetContext
LOWninja/signature/details.py275 # 1) if type of the param is defined as one of the Param's subclasses - we just use that definitionCOMMENT
MEDIUM⚡ninja/static/ninja/redoc.standalone.js2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):"function"==typeof deCODE
MEDIUM⚡ninja/static/ninja/redoc.standalone.js2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):"function"==typeof deCODE
MEDIUM⚡ninja/static/ninja/redoc.standalone.js2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):"function"==typeof deCODE
Over-Commented Block7 hits · 7 pts
SeverityFileLineSnippetContext
LOWtests/test_forms.py81# username: strCOMMENT
LOWtests/test_union.py1# This is no longer the case in pydantic 2COMMENT
LOWtests/test_union.py21# assert client.get("/test?value=today").json() == ["today", "str"]COMMENT
LOWdocs/docs/guide/model-schema.md61 class Meta:COMMENT
LOWninja/schema.py141COMMENT
LOWninja/static/ninja/swagger-ui-init.js21// configObject.requestInterceptor = (req) => {COMMENT
LOWninja/static/ninja/swagger-ui-init.js41// req.headers['X-CSRFToken'] = swaggerUi.dataset.csrfTokenCOMMENT
Excessive Try-Catch Wrapping7 hits · 7 pts
SeverityFileLineSnippetContext
LOWtests/test_app.py98 except Exception:CODE
LOWninja/operation.py233 except Exception as e:CODE
LOWninja/operation.py333 except Exception as exc:CODE
LOWninja/operation.py512 except Exception as e:CODE
LOWninja/operation.py571 except Exception as exc:CODE
LOWninja/security/http.py84 except Exception as e: # dear contributors please do not change to valueerror - here can be multiple exceptionsCODE
LOWninja/params/models.py137 except Exception as e:CODE
Empty Error Handlers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHtests/test_schema.py211except ValidationError:CODE
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWninja/static/ninja/redoc.standalone.js41`;class As extends n.PureComponent{render(){return n.createElement("div",{style:{textAlign:"center"}},n.createElement(_sCODE
LOWninja/static/ninja/redoc.standalone.js752`;var Bd=Object.defineProperty,Ud=Object.defineProperties,qd=Object.getOwnPropertyDescriptors,Vd=Object.getOwnPropertySyCODE
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_app.py16# make sure to check how this will work with versioningCOMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWninja/pagination.py619 # Check if Input schema has any fieldsCOMMENT
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWtests/test_auth.py363 async def handle_request(request):CODE