This report summarizes scanner evidence for tortoise/tortoise-orm. SynthScan examined 61,240 lines of code across 364 source files, recording 1463 pattern matches distributed across 19 syntactic categories. The legacy adjusted pattern signal is 35.9 (High 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.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 1048 finding(s).
Are imports declared and package/API names verified? 180 finding(s).
Are wrappers, guards, and repeated structures necessary? 1226 finding(s).
Which changes need focused human review? 1463 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
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.
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.
The scanner identified 1463 distinct pattern matches across 19 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test_query_api.py | 159 | async def test_execute_pypika_invalid_schema_raises(query_api_db) -> None: | CODE |
| LOW⚡ | tests/test_query_api.py | 277 | async def test_execute_pypika_explicit_connection_with_multiple_configured() -> None: | CODE |
| LOW⚡ | tests/test_query_api.py | 287 | async def execute_query_dict_with_affected(self, query, values=None): | CODE |
| LOW | tests/test_query_api.py | 67 | async def test_execute_pypika_metadata(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 77 | async def test_execute_pypika_update_rows_affected(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 88 | async def test_execute_pypika_insert_rows_affected(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 99 | async def test_query_parameterization(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 111 | async def test_execute_pypika_pydantic_schema(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 122 | async def test_execute_pypika_pydantic_type_adapter(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 136 | async def test_execute_pypika_typed_dict_schema(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 148 | async def test_execute_pypika_empty_result(query_api_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 211 | async def test_rows_affected_select_sqlite(rows_affected_setup) -> None: | CODE |
| LOW | tests/test_query_api.py | 220 | async def test_rows_affected_select_asyncpg(rows_affected_setup) -> None: | CODE |
| LOW | tests/test_query_api.py | 232 | async def test_rows_affected_select_driver_rowcount(rows_affected_setup) -> None: | CODE |
| LOW | tests/test_query_api.py | 247 | async def test_rows_affected_update(rows_affected_setup) -> None: | CODE |
| LOW | tests/test_query_api.py | 259 | async def test_rows_affected_delete(rows_affected_setup) -> None: | CODE |
| LOW | tests/test_query_api.py | 340 | async def test_execute_pypika_requires_connection_with_multiple_configured(multi_db) -> None: | CODE |
| LOW | tests/test_query_api.py | 350 | async def test_subquery_params_inline(query_api_db) -> None: | CODE |
| LOW⚡ | tests/test_concurrency.py | 18 | async def test_concurrency_read_isolated(db_isolated) -> None: | CODE |
| LOW⚡ | tests/test_concurrency.py | 27 | async def test_concurrency_create_isolated(db_isolated) -> None: | CODE |
| LOW⚡ | tests/test_concurrency.py | 35 | async def test_nonconcurrent_get_or_create_isolated(db_isolated) -> None: | CODE |
| LOW⚡ | tests/test_concurrency.py | 299 | async def test_concurrency_read_transactioned(db) -> None: | CODE |
| LOW⚡ | tests/test_concurrency.py | 309 | async def test_concurrency_create_transactioned(db) -> None: | CODE |
| LOW⚡ | tests/test_concurrency.py | 318 | async def test_nonconcurrent_get_or_create_transactioned(db) -> None: | CODE |
| LOW⚡ | tests/test_concurrency.py | 334 | async def test_concurrent_queries_lazy_init(db_isolated) -> None: | CODE |
| LOW | tests/test_concurrency.py | 53 | async def test_concurrent_create_applies_defaults( | CODE |
| LOW | tests/test_concurrency.py | 61 | async def synchronized_create_or_get( | CODE |
| LOW | tests/test_concurrency.py | 108 | async def test_update_or_create_refreshes_after_create_race(db_isolated, monkeypatch) -> None: | CODE |
| LOW | tests/test_concurrency.py | 132 | async def test_update_or_create_retries_deleted_race_winner(db_isolated, monkeypatch) -> None: | CODE |
| LOW | tests/test_concurrency.py | 159 | async def test_update_or_create_updates_recreated_race_winner(db_isolated, monkeypatch) -> None: | CODE |
| LOW | tests/test_concurrency.py | 190 | async def test_update_or_create_repeated_deletions_terminate(db_isolated, monkeypatch) -> None: | CODE |
| LOW | tests/test_concurrency.py | 218 | async def test_update_or_create_race_in_existing_transaction(db_isolated, monkeypatch) -> None: | CODE |
| LOW | tests/test_concurrency.py | 241 | async def test_concurrent_get_or_create_isolated(db_isolated) -> None: | CODE |
| LOW | tests/test_concurrency.py | 252 | async def test_concurrent_transactions_with_multiple_ops(db_isolated) -> None: | CODE |
| LOW | tests/test_concurrency.py | 266 | async def test_concurrent_transactions_with_single_op(db_isolated) -> None: | CODE |
| LOW | tests/test_concurrency.py | 280 | async def test_nested_concurrent_transactions_with_multiple_ops(db_isolated) -> None: | CODE |
| LOW | tests/test_concurrency.py | 347 | async def test_concurrent_transactions_lazy_init(db_isolated) -> None: | CODE |
| LOW | tests/test_group_by.py | 36 | async def test_count_group_by_with_join(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 49 | async def test_count_filter_group_by(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 76 | async def test_sum_group_by_with_join(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 117 | async def test_avg_group_by_with_join(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 142 | async def test_count_values_list_group_by(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 162 | async def test_count_values_list_group_by_with_join(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 172 | async def test_count_values_list_filter_group_by(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 184 | async def test_sum_values_list_group_by(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 201 | async def test_sum_values_list_group_by_with_join(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 211 | async def test_sum_values_list_filter_group_by(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 223 | async def test_avg_values_list_group_by(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 241 | async def test_avg_values_list_group_by_with_join(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 251 | async def test_avg_values_list_filter_group_by(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 269 | async def test_group_by_annotate_result(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 282 | async def test_group_by_requiring_nested_joins(db): | CODE |
| LOW | tests/test_group_by.py | 308 | async def test_group_by_ambigious_column(db): | CODE |
| LOW | tests/test_group_by.py | 328 | async def test_group_by_nested_column(db): | CODE |
| LOW | tests/test_group_by.py | 353 | async def test_group_by_id_with_nested_filter(db, group_by_data): | CODE |
| LOW | tests/test_group_by.py | 361 | async def test_select_subquery_with_group_by(db, group_by_data): | CODE |
| LOW⚡ | tests/test_f.py | 68 | async def test_values_with_json_field_attribute(db): | CODE |
| LOW⚡ | tests/test_f.py | 77 | async def test_values_with_json_field_attribute_of_attribute(db): | CODE |
| LOW⚡ | tests/test_f.py | 86 | async def test_values_with_json_field_str_array_element(db): | CODE |
| LOW | tests/test_f.py | 101 | async def test_values_with_json_field_array_attribute(db): | CODE |
| 921 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | conftest.py | 26 | # ============================================================================ | COMMENT |
| MEDIUM | conftest.py | 28 | # ============================================================================ | COMMENT |
| MEDIUM | conftest.py | 41 | # ============================================================================ | COMMENT |
| MEDIUM | conftest.py | 44 | # ============================================================================ | COMMENT |
| MEDIUM | conftest.py | 179 | # ============================================================================ | COMMENT |
| MEDIUM | conftest.py | 181 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_query_api.py | 167 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_query_api.py | 170 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_query_api.py | 270 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_query_api.py | 273 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_query_api.py | 40 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_query_api.py | 43 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_concurrency.py | 12 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_concurrency.py | 14 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_concurrency.py | 292 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_concurrency.py | 294 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_concurrency.py | 327 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_concurrency.py | 330 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 93 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 95 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 161 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 163 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 217 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 219 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 285 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | tests/test_only.py | 287 | # ============================================================================ | COMMENT |
| MEDIUM | tests/test_only.py | 8 | # ============================================================================ | COMMENT |
| MEDIUM | tests/test_only.py | 10 | # ============================================================================ | COMMENT |
| MEDIUM | tests/test_only.py | 25 | # ============================================================================ | COMMENT |
| MEDIUM | tests/test_only.py | 27 | # ============================================================================ | COMMENT |
| MEDIUM | tests/test_only.py | 271 | # ============================================================================ | COMMENT |
| MEDIUM | tests/test_only.py | 273 | # ============================================================================ | COMMENT |
| MEDIUM | tests/test_q.py | 10 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_q.py | 12 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_q.py | 166 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_q.py | 168 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | tests/test_truncate.py | 13 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_truncate.py | 15 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_truncate.py | 71 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_truncate.py | 73 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 22 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 24 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 55 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 57 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 90 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 92 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 130 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 132 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 192 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 194 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 224 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 226 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 246 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 248 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 268 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_model_construct.py | 270 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_model_construct.py | 162 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_model_construct.py | 164 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_model_construct.py | 176 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_model_construct.py | 178 | # --------------------------------------------------------------------------- | COMMENT |
| 98 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | conftest.py | 22 | except ImportError: | CODE |
| HIGH | tests/test_transactions.py | 296 | except KeyError: | CODE |
| HIGH | tests/test_transactions.py | 326 | except KeyError: | CODE |
| HIGH | tests/test_transactions.py | 356 | except KeyError: | CODE |
| HIGH | tests/test_transactions.py | 385 | except KeyError: | CODE |
| HIGH | tests/test_manual_sql.py | 34 | except ValueError: | CODE |
| HIGH | tests/test_manual_sql.py | 61 | except ValueError: | CODE |
| HIGH | tests/backends/test_mysql.py | 64 | except ImportError: | CODE |
| HIGH | tests/backends/test_mysql.py | 92 | except ConnectionError: | CODE |
| HIGH | docs/sphinx_autodoc_typehints.py | 211 | except (AttributeError, TypeError, RecursionError): | CODE |
| HIGH | docs/sphinx_autodoc_typehints.py | 235 | except (AttributeError, TypeError): | CODE |
| HIGH | docs/sphinx_autodoc_typehints.py | 43 | except TypeError: | CODE |
| HIGH | docs/sphinx_autodoc_typehints.py | 136 | except TypeError: | CODE |
| HIGH | examples/transactions.py | 33 | except OperationalError: | CODE |
| HIGH | examples/transactions.py | 48 | except OperationalError: | CODE |
| HIGH | examples/relations.py | 86 | except NoValuesFetched: | CODE |
| HIGH | tortoise/models.py | 1314 | except DoesNotExist: | CODE |
| HIGH | tortoise/validators.py | 344 | except ValidationError: | CODE |
| HIGH | tortoise/router.py | 24 | except AttributeError: | CODE |
| HIGH | tortoise/backends/asyncpg/client.py | 102 | except asyncpg.InvalidCatalogNameError: # pragma: nocoverage | CODE |
| HIGH | tortoise/backends/sqlite/client.py | 115 | except FileNotFoundError: # pragma: nocoverage | CODE |
| HIGH | tortoise/backends/mysql/client.py | 177 | except errors.DatabaseError: # pragma: nocoverage | CODE |
| HIGH | tortoise/backends/psycopg/client.py | 146 | except psycopg.errors.InvalidCatalogName: # pragma: nocoverage | CODE |
| HIGH | tortoise/backends/base/schema_generator.py | 406 | except NotImplementedError: | CODE |
| HIGH | tortoise/backends/base/schema_generator.py | 416 | except NotImplementedError: | CODE |
| HIGH | tortoise/cli/utils.py | 177 | except (ModuleNotFoundError, AttributeError, ValueError): | CODE |
| HIGH | tortoise/contrib/pylint/__init__.py | 136 | except AstroidError: | CODE |
| HIGH | tortoise/contrib/pylint/__init__.py | 59 | except AttributeError: | CODE |
| HIGH | tortoise/contrib/pydantic/utils.py | 29 | except Exception: # nosec B110 | CODE |
| HIGH | tortoise/fields/base.py | 440 | except AttributeError: | CODE |
| HIGH | tortoise/fields/base.py | 386 | except TypeError: | CODE |
| HIGH | tortoise/fields/base.py | 506 | except (AttributeError, TypeError): | CODE |
| HIGH | tortoise/fields/data.py | 89 | except ImportError: # pragma: nocoverage | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_query_api.py | 1 | CODE | |
| LOW | tests/test_primary_key.py | 1 | CODE | |
| LOW | tests/test_signals.py | 1 | CODE | |
| LOW | tests/test_update.py | 1 | CODE | |
| LOW | tests/backends/test_mysql.py | 60 | CODE | |
| LOW | tests/utils/fake_client.py | 1 | CODE | |
| LOW | tests/utils/test_describe_model.py | 1 | CODE | |
| LOW | tests/model_setup/model_bad_rel2.py | 6 | CODE | |
| LOW | tests/cli/test_cli.py | 1 | CODE | |
| LOW | tests/schema/models_m2m_2.py | 5 | CODE | |
| LOW | tests/schema/models_fk_1.py | 5 | CODE | |
| LOW | tests/benchmarks/conftest.py | 1 | CODE | |
| LOW | tests/fields/test_db_index.py | 1 | CODE | |
| LOW | tests/fields/test_db_default.py | 1 | CODE | |
| LOW | tests/fields/subclass_fields.py | 1 | CODE | |
| LOW | docs/type_globals.py | 1 | CODE | |
| LOW | docs/type_globals.py | 2 | CODE | |
| LOW | docs/type_globals.py | 3 | CODE | |
| LOW | examples/signals.py | 5 | CODE | |
| LOW | examples/comprehensive_migrations_project/models.py | 8 | CODE | |
| LOW | examples/schema_migrations_project/models.py | 14 | CODE | |
| LOW | examples/migrations_project/models.py | 1 | CODE | |
| LOW | examples/blacksheep/server.py | 2 | CODE | |
| LOW | examples/fastapi/schemas.py | 1 | CODE | |
| LOW | examples/multiapp_migrations_project/catalog/models.py | 1 | CODE | |
| LOW | examples/multiapp_migrations_project/accounts/models.py | 1 | CODE | |
| LOW | examples/multiapp_migrations_project/orders/models.py | 1 | CODE | |
| LOW | tortoise/signals.py | 1 | CODE | |
| LOW | tortoise/config.py | 1 | CODE | |
| LOW | tortoise/models.py | 1 | CODE | |
| LOW | tortoise/transactions.py | 1 | CODE | |
| LOW | tortoise/validators.py | 1 | CODE | |
| LOW | tortoise/__init__.py | 1 | CODE | |
| LOW | tortoise/__init__.py | 17 | CODE | |
| LOW | tortoise/__init__.py | 17 | CODE | |
| LOW | tortoise/__init__.py | 17 | CODE | |
| LOW | tortoise/__init__.py | 17 | CODE | |
| LOW | tortoise/__init__.py | 17 | CODE | |
| LOW | tortoise/apps.py | 1 | CODE | |
| LOW | tortoise/apps.py | 16 | CODE | |
| LOW | tortoise/apps.py | 16 | CODE | |
| LOW | tortoise/connection.py | 1 | CODE | |
| LOW | tortoise/context.py | 19 | CODE | |
| LOW | tortoise/indexes.py | 1 | CODE | |
| LOW | tortoise/utils.py | 1 | CODE | |
| LOW | tortoise/schema_quoting.py | 9 | CODE | |
| LOW | tortoise/query_api.py | 1 | CODE | |
| LOW | tortoise/exceptions.py | 1 | CODE | |
| LOW | tortoise/converters.py | 1 | CODE | |
| LOW | tortoise/router.py | 1 | CODE | |
| LOW | tortoise/timezone.py | 1 | CODE | |
| LOW | tortoise/manager.py | 1 | CODE | |
| LOW | tortoise/query_utils.py | 1 | CODE | |
| LOW | tortoise/filters.py | 1 | CODE | |
| LOW | tortoise/backends/asyncpg/client.py | 1 | CODE | |
| LOW | tortoise/backends/asyncpg/schema_generator.py | 1 | CODE | |
| LOW | tortoise/backends/asyncpg/executor.py | 1 | CODE | |
| LOW | tortoise/backends/oracle/client.py | 1 | CODE | |
| LOW | tortoise/backends/oracle/schema_generator.py | 1 | CODE | |
| LOW | tortoise/backends/oracle/executor.py | 1 | CODE | |
| 105 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/model_setup/model_bad_rel8.py | 0 | testing models for a bad/wrong relation reference wrong reference. fk field parameter `to_field` with non exist field. | STRING |
| HIGH | tests/model_setup/model_bad_rel9.py | 0 | testing models for a bad/wrong relation reference wrong reference. fk field parameter `to_field` with non exist field. | STRING |
| HIGH | tests/model_setup/model_bad_rel6.py | 0 | testing models for a bad/wrong relation reference wrong reference. fk field parameter `to_field` with non exist field. | STRING |
| HIGH | tests/model_setup/model_bad_rel7.py | 0 | testing models for a bad/wrong relation reference wrong reference. fk field parameter `to_field` with non exist field. | STRING |
| HIGH | tests/model_setup/test_init.py | 0 | helper to reset tortoise state before each test. note: we must not set tortoise.apps = none or tortoise._inited = false | STRING |
| HIGH | tests/model_setup/test_bad_relation_reference.py | 0 | helper to reset tortoise state before each test. note: we must not set tortoise.apps = none or tortoise._inited = false | STRING |
| HIGH | tests/schema/test_generate_schema.py | 0 | helper to reset tortoise state before each test. note: we must not set tortoise.apps = none or tortoise._inited = false | STRING |
| HIGH | tests/schema/models_no_auto_create_m2m.py | 0 | this example demonstrates sql schema generation for each db type supported. | STRING |
| HIGH | tests/schema/models_schema_create.py | 0 | this example demonstrates sql schema generation for each db type supported. | STRING |
| HIGH | examples/schema_create.py | 0 | this example demonstrates sql schema generation for each db type supported. | STRING |
| HIGH | tortoise/contrib/aiohttp/__init__.py | 0 | registers tortoise-orm with set-up at the beginning of fastapi application's lifespan (which allow user to read/write da | STRING |
| HIGH | tortoise/contrib/quart/__init__.py | 0 | registers tortoise-orm with set-up at the beginning of fastapi application's lifespan (which allow user to read/write da | STRING |
| HIGH | tortoise/contrib/starlette/__init__.py | 0 | registers tortoise-orm with set-up at the beginning of fastapi application's lifespan (which allow user to read/write da | STRING |
| HIGH | tortoise/contrib/blacksheep/__init__.py | 0 | registers tortoise-orm with set-up at the beginning of fastapi application's lifespan (which allow user to read/write da | STRING |
| HIGH | tortoise/contrib/fastapi/__init__.py | 0 | registers tortoise-orm with set-up at the beginning of fastapi application's lifespan (which allow user to read/write da | STRING |
| HIGH | tortoise/contrib/sanic/__init__.py | 0 | registers tortoise-orm with set-up at the beginning of fastapi application's lifespan (which allow user to read/write da | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH⚡ | tests/test_source_field.py | 267 | assert {(o.chars, o.null) for o in objs} == {("aaa", "null"), ("bbb", "null")} | CODE |
| HIGH | tortoise/functions.py | 32 | Provides a default value if field is null. | STRING |
| HIGH | tortoise/apps.py | 228 | null=fk_object.null, | CODE |
| HIGH | tortoise/contrib/pydantic/creator.py | 509 | if not field.pk and (field_name in self._optional or field.null): | CODE |
| HIGH | tortoise/fields/relational.py | 366 | super().__init__(field_type, null=null, **kwargs) | CODE |
| HIGH | tortoise/fields/relational.py | 523 | to, related_name, on_delete, db_constraint=db_constraint, null=null, **kwargs | CODE |
| HIGH | tortoise/fields/relational.py | 598 | to, related_name, on_delete, db_constraint=db_constraint, null=null, **kwargs | CODE |
| HIGH | tortoise/fields/base.py | 479 | "default": ... # The default value (coerced to int/float/str/bool/null) | STRING |
| HIGH | tortoise/fields/base.py | 536 | "nullable": self.null, | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_concurrency.py | 53 | CODE | |
| LOW | tests/test_default.py | 28 | CODE | |
| LOW | docs/sphinx_autodoc_typehints.py | 22 | CODE | |
| LOW | docs/sphinx_autodoc_typehints.py | 156 | CODE | |
| LOW | docs/sphinx_autodoc_typehints.py | 335 | CODE | |
| LOW | docs/sphinx_autodoc_typehints.py | 358 | CODE | |
| LOW | tortoise/models.py | 511 | CODE | |
| LOW | tortoise/models.py | 641 | CODE | |
| LOW | tortoise/models.py | 746 | CODE | |
| LOW | tortoise/models.py | 782 | CODE | |
| LOW | tortoise/models.py | 825 | CODE | |
| LOW | tortoise/models.py | 954 | CODE | |
| LOW | tortoise/models.py | 1135 | CODE | |
| LOW | tortoise/expressions.py | 126 | CODE | |
| LOW | tortoise/apps.py | 126 | CODE | |
| LOW | tortoise/queryset.py | 219 | CODE | |
| LOW | tortoise/queryset.py | 2285 | CODE | |
| LOW | tortoise/backends/sqlite/client.py | 200 | CODE | |
| LOW | tortoise/backends/sqlite/executor.py | 67 | CODE | |
| LOW | tortoise/backends/mysql/client.py | 111 | CODE | |
| LOW | tortoise/backends/base/client.py | 373 | CODE | |
| LOW | tortoise/backends/base/executor.py | 110 | CODE | |
| LOW | tortoise/backends/base/executor.py | 651 | CODE | |
| LOW | tortoise/cli/cli.py | 211 | CODE | |
| LOW | tortoise/cli/cli.py | 373 | CODE | |
| LOW | tortoise/cli/cli.py | 493 | CODE | |
| LOW | tortoise/cli/cli.py | 506 | CODE | |
| LOW | tortoise/cli/utils.py | 167 | CODE | |
| LOW | tortoise/contrib/pylint/__init__.py | 36 | CODE | |
| LOW | tortoise/contrib/test/__init__.py | 69 | CODE | |
| LOW | tortoise/contrib/test/__init__.py | 121 | CODE | |
| LOW | tortoise/contrib/pydantic/creator.py | 326 | CODE | |
| LOW | tortoise/contrib/pydantic/base.py | 20 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | tortoise/expressions.py | 366 | resolve_context.model._meta.db.executor_class.get_overridden_filter_func( | CODE |
| CRITICAL | tortoise/queryset.py | 183 | wrapped = self.model._meta.db.query_class.from_(inner.as_(alias)).select( | CODE |
| CRITICAL | tortoise/queryset.py | 1488 | self.query = self.model._meta.db.query_class.from_(table).where( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_context.py | 520 | # Create a record | COMMENT |
| MEDIUM | examples/pydantic/tutorial_2.py | 25 | # Define the default ordering | COMMENT |
| MEDIUM | examples/pydantic/tutorial_2.py | 30 | # Create a list of models for population from a queryset. | COMMENT |
| MEDIUM | tortoise/indexes.py | 68 | # This function is required by aerich | COMMENT |
| MEDIUM | tortoise/indexes.py | 74 | # This function is required by aerich | COMMENT |
| MEDIUM⚡ | tortoise/backends/base/schema_generator.py | 107 | # This method provides a mechanism where you can perform a set of | COMMENT |
| MEDIUM | tortoise/backends/base/schema_generator.py | 126 | # This method provides a default method to escape comment strings as per | COMMENT |
| MEDIUM | tortoise/backends/base/config_generator.py | 129 | # Create an alias for backwards compatibility | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tortoise/config.py | 221 | Load configuration from a YAML or JSON file. Args: config_file (str): Path to the configur | STRING |
| HIGH | tortoise/config.py | 252 | Create a TortoiseConfig instance using a database URL and app modules mapping. This factory method bui | STRING |
| HIGH | tortoise/config.py | 281 | Parse and resolve multiple configuration argument sources into a unified TortoiseConfig instance. Acce | STRING |
| HIGH | tortoise/context.py | 380 | Retrieve a model by app label and model name. Args: app_label: The app label (e.g., "model | STRING |
| HIGH | tortoise/context.py | 400 | Get a database connection by name. Args: connection_name: The connection alias. If None, u | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/sphinx_autodoc_typehints.py | 56 | except Exception: | CODE |
| LOW | docs/sphinx_autodoc_typehints.py | 59 | except Exception: | CODE |
| LOW | docs/sphinx_autodoc_typehints.py | 218 | except Exception as exc: | CODE |
| LOW | docs/sphinx_autodoc_typehints.py | 240 | except Exception: | CODE |
| LOW | tortoise/__init__.py | 459 | except Exception as e: | CODE |
| LOW | tortoise/context.py | 351 | except Exception: | CODE |
| LOW | tortoise/query_api.py | 26 | except Exception: # pragma: nocoverage | CODE |
| LOW | tortoise/query_api.py | 34 | except Exception: # pragma: nocoverage | CODE |
| LOW | tortoise/backends/asyncpg/client.py | 125 | except Exception: | CODE |
| LOW | tortoise/backends/sqlite/client.py | 141 | except Exception: | CODE |
| LOW | tortoise/backends/odbc/client.py | 131 | except Exception: | CODE |
| LOW | tortoise/backends/mysql/client.py | 204 | except Exception: | CODE |
| LOW | tortoise/cli/utils.py | 86 | except Exception as exc: | CODE |
| LOW | tortoise/contrib/pydantic/utils.py | 29 | except Exception: # nosec B110 | CODE |
| LOW | tortoise/contrib/pydantic/utils.py | 33 | except Exception: | CODE |
| LOW | tortoise/fields/data.py | 792 | except Exception as e: | CODE |
| LOW | tortoise/fields/data.py | 812 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_concurrency.py | 200 | async def update_during_churn() -> None: | CODE |
| LOW | docs/sphinx_autodoc_typehints.py | 17 | logger = logging.getLogger(__name__) | CODE |
| LOW | tortoise/models.py | 893 | def _set_pk_val(self, value: Any) -> None: | CODE |
| LOW | tortoise/models.py | 1102 | async def _set_async_default_field(self) -> None: | CODE |
| LOW | tortoise/__init__.py | 589 | __all__ = [ | CODE |
| LOW | tortoise/connection.py | 68 | def _set_storage(self, new_storage: dict[str, BaseDBAsyncClient]) -> None: | CODE |
| LOW | tortoise/context.py | 71 | def set_global_context(ctx: TortoiseContext) -> None: | CODE |
| LOW | tortoise/context.py | 561 | __all__ = [ | CODE |
| LOW | tortoise/cli/__init__.py | 3 | __all__ = ["main"] | CODE |
| LOW | tortoise/fields/__init__.py | 44 | __all__ = [ | CODE |
| LOW | tortoise/fields/relational.py | 154 | def _set_result_for_query(self, sequence: list[MODEL], attr: str | None = None) -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tortoise/__init__.py | 277 | CODE | |
| LOW | tortoise/context.py | 239 | CODE | |
| LOW | tortoise/backends/base/client.py | 70 | CODE | |
| LOW | tortoise/contrib/starlette/__init__.py | 22 | CODE | |
| LOW | tortoise/contrib/postgres/search.py | 333 | CODE | |
| LOW | tortoise/contrib/fastapi/__init__.py | 119 | CODE | |
| LOW | tortoise/contrib/pydantic/creator.py | 612 | CODE | |
| LOW | tortoise/contrib/pydantic/creator.py | 189 | CODE | |
| LOW | tortoise/fields/base.py | 220 | CODE | |
| LOW | tortoise/fields/data.py | 926 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | examples/enum_fields.py | 30 | # also you can use valid int and str value directly | COMMENT |
| MEDIUM | examples/enum_fields.py | 42 | # also you can use valid int and str value directly | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test_validators.py | 244 | "user@example.com", | CODE |
| LOW⚡ | tests/test_validators.py | 261 | validator("user@example.com") | CODE |
| LOW⚡ | tests/test_validators.py | 266 | validator("user@example.com") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 1 | # | COMMENT |
| LOW | docs/conf.py | 181 | # The name for this set of Sphinx documents. If None, it defaults to | COMMENT |
| LOW | docs/conf.py | 201 | # The default sidebars (for documents that don't match any pattern) are | COMMENT |
| LOW | docs/conf.py | 221 | # The font size ('10pt', '11pt' or '12pt'). | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | conftest.py | 90 | # Check if the database supports transactions | COMMENT |
| LOW | tests/contrib/test_decorator.py | 15 | # Set PYTHONPATH to use local source instead of installed package | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_source_field.py | 234 | async def test_function(self, db): | CODE |
| LOW | tortoise/__init__.py | 552 | async def do_stuff(): | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tortoise/backends/base/client.py | 308 | """Wraps the connections with a lock to facilitate safe concurrent access when using | STRING |