Data validation using Python type hints
This report summarizes scanner evidence for pydantic/pydantic, a Python project with 28,972 GitHub stars. SynthScan examined 251,439 lines of code across 771 source files, recording 3799 pattern matches distributed across 19 syntactic categories. The legacy adjusted pattern signal is 15.6 (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.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 3301 finding(s).
Are imports declared and package/API names verified? 395 finding(s).
Are wrappers, guards, and repeated structures necessary? 3176 finding(s).
Which changes need focused human review? 3799 finding(s).
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.
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 3799 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_assert_in_validators.py | 23 | def test_assert_raises_validation_error(): | CODE |
| LOW | tests/test_freethreaded.py | 38 | def test_typed_dict_concurrent_type_adapter() -> None: | CODE |
| LOW | tests/test_freethreaded.py | 51 | def test_base_model_concurrent_creation_with_shared_base() -> None: | CODE |
| LOW | tests/test_freethreaded.py | 82 | def test_dataclass_concurrent_creation_with_shared_base() -> None: | CODE |
| LOW | tests/test_freethreaded.py | 114 | def test_model_rebuild_concurrent_subclass_creation(monkeypatch: pytest.MonkeyPatch) -> None: | CODE |
| LOW | tests/test_freethreaded.py | 146 | def test_model_force_rebuild_concurrent_instantiation() -> None: | CODE |
| LOW | tests/test_dunder_all.py | 13 | def test_explicit_reexports_exist() -> None: | CODE |
| LOW⚡ | tests/test_version.py | 31 | def test_version_attribute_is_present(): | CODE |
| LOW⚡ | tests/test_version.py | 35 | def test_version_attribute_is_a_string(): | CODE |
| LOW⚡ | tests/test_version.py | 39 | def test_check_pydantic_core_version() -> None: | CODE |
| LOW | tests/test_computed_fields.py | 69 | def test_computed_fields_json_schema(): | CODE |
| LOW | tests/test_computed_fields.py | 217 | def test_properties_and_computed_fields(): | CODE |
| LOW | tests/test_computed_fields.py | 244 | def test_computed_fields_repr(): | CODE |
| LOW | tests/test_computed_fields.py | 426 | def test_private_computed_field(): | CODE |
| LOW | tests/test_computed_fields.py | 546 | def test_abstractmethod_missing(bases: tuple[Any, ...]): | CODE |
| LOW⚡ | tests/test_computed_fields.py | 567 | def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema: | CODE |
| LOW⚡ | tests/test_computed_fields.py | 573 | def test_computed_fields_infer_return_type(): | CODE |
| LOW⚡ | tests/test_computed_fields.py | 583 | def test_computed_fields_missing_return_type(): | CODE |
| LOW | tests/test_computed_fields.py | 611 | def my_aliased_computed_field_none(self) -> int: | CODE |
| LOW | tests/test_computed_fields.py | 660 | def test_alias_generator_defer_build() -> None: | CODE |
| LOW | tests/test_computed_fields.py | 740 | def test_multiple_references_to_schema(model_factory: Callable[[], Any]) -> None: | CODE |
| LOW | tests/test_computed_fields.py | 765 | def test_generic_computed_field(): | CODE |
| LOW | tests/test_computed_fields.py | 796 | def test_computed_field_override_raises(): | CODE |
| LOW | tests/test_computed_fields.py | 812 | def test_computed_field_excluded_from_model_dump_recursive() -> None: | CODE |
| LOW | tests/test_computed_fields.py | 828 | def test_computed_field_with_field_serializer(): | CODE |
| LOW | tests/test_computed_fields.py | 844 | def test_computed_fields_exclude() -> None: | CODE |
| LOW | tests/test_computed_fields.py | 859 | def test_computed_fields_serialization_exclude_if() -> None: | CODE |
| LOW | tests/test_computed_fields.py | 881 | def test_computed_fields_serialization_exclude_if_from_annotated() -> None: | CODE |
| LOW | tests/test_lazy_imports.py | 33 | def test_lazy_import_in_annotation(create_module) -> None: | CODE |
| LOW | tests/test_lazy_imports.py | 49 | def test_lazy_import_circular_models(import_lazy_modules) -> None: | STRING |
| LOW | tests/test_lazy_imports.py | 86 | def test_lazy_import_circular_dataclasses(import_lazy_modules) -> None: | STRING |
| LOW | tests/test_lazy_imports.py | 117 | def test_lazy_import_missing_module(create_module) -> None: | STRING |
| LOW | tests/test_lazy_imports.py | 146 | def test_lazy_import_missing_name(create_module) -> None: | STRING |
| LOW | tests/test_v1.py | 34 | def test_isinstance_does_not_raise_deprecation_warnings(): | CODE |
| LOW | tests/test_utils.py | 39 | def test_import_module_invalid(): | CODE |
| LOW | tests/test_utils.py | 94 | def test_lenient_issubclass_with_generic_aliases(): | CODE |
| LOW | tests/test_utils.py | 101 | def test_lenient_issubclass_is_lenient(): | CODE |
| LOW | tests/test_utils.py | 318 | def test_deep_update_is_not_mutating(): | CODE |
| LOW⚡ | tests/test_utils.py | 364 | def test_smart_deepcopy_immutable_non_sequence(obj, mocker): | CODE |
| LOW⚡ | tests/test_utils.py | 372 | def test_smart_deepcopy_empty_collection(empty_collection, mocker): | CODE |
| LOW⚡ | tests/test_utils.py | 382 | def test_smart_deepcopy_collection(collection, mocker): | CODE |
| LOW⚡ | tests/test_utils.py | 389 | def test_smart_deepcopy_error(error, mocker): | CODE |
| LOW⚡ | tests/test_utils.py | 439 | def test_on_lower_camel_zero_length(): | CODE |
| LOW⚡ | tests/test_utils.py | 443 | def test_on_lower_camel_one_length(): | CODE |
| LOW⚡ | tests/test_utils.py | 447 | def test_on_lower_camel_many_length(): | CODE |
| LOW | tests/conftest.py | 37 | def _extract_source_code_from_function(function: FunctionType): | CODE |
| LOW | tests/conftest.py | 160 | def generate_schema_call_counter(*args: Any, **kwargs: Any) -> Any: | CODE |
| LOW⚡ | tests/test_warnings.py | 5 | def test_pydantic_deprecation_warning(): | CODE |
| LOW⚡ | tests/test_warnings.py | 13 | def test_pydantic_deprecation_warning_tailing_dot_in_message(): | CODE |
| LOW⚡ | tests/test_warnings.py | 20 | def test_pydantic_deprecation_warning_calculated_expected_removal(): | CODE |
| LOW | tests/test_decorators.py | 11 | def _two_pos_required_args_extra_optional(a, b, c=1, d=2, *, e=3): | CODE |
| LOW | tests/test_decorators.py | 19 | def _one_pos_required_arg_one_optional(a, b=1): | CODE |
| LOW | tests/test_decorators.py | 47 | def test_inspect_validator_error_wrap(): | CODE |
| LOW | tests/test_decorators.py | 62 | def test_inspect_validator_error(mode): | CODE |
| LOW | tests/test_decorators.py | 76 | def test_inspect_field_serializer_no_signature() -> None: | CODE |
| LOW⚡ | tests/test_decorators.py | 100 | def test_inspect_annotated_serializer(obj, mode, expected): | CODE |
| LOW⚡ | tests/test_decorators.py | 105 | def test_inspect_annotated_serializer_invalid_number_of_arguments(mode): | CODE |
| LOW⚡ | tests/test_decorators.py | 114 | def test_plain_class_not_mutated() -> None: | CODE |
| LOW | tests/test_decorators.py | 128 | def test_decorator_info_not_mutated() -> None: | CODE |
| LOW⚡ | tests/test_types_typeddict.py | 1115 | def test_typeddict_extraitems_readonly() -> None: | CODE |
| 2946 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_exports.py | 124 | except ValueError: | CODE |
| HIGH | tests/test_exports.py | 143 | except ValueError: | CODE |
| HIGH | tests/test_generics.py | 2493 | except TestingException: | CODE |
| HIGH | tests/test_edge_cases.py | 3264 | except PydanticSchemaGenerationError: | CODE |
| HIGH | pydantic-core/tests/test_tzinfo.py | 176 | except ZoneInfoNotFoundError: | CODE |
| HIGH | pydantic-core/tests/test_schema_functions.py | 377 | except ValidationError: | CODE |
| HIGH | pydantic-core/tests/serializers/test_functions.py | 458 | except PydanticOmit: | CODE |
| HIGH | pydantic-core/tests/serializers/test_functions.py | 489 | except PydanticOmit: | CODE |
| HIGH | …antic-core/tests/benchmarks/test_complete_benchmark.py | 136 | except ValueError: | CODE |
| HIGH | pydantic-core/tests/benchmarks/test_micro_benchmarks.py | 196 | except ValidationError: | CODE |
| HIGH | pydantic-core/tests/benchmarks/test_micro_benchmarks.py | 221 | except ValidationError: | CODE |
| HIGH | pydantic-core/tests/benchmarks/test_micro_benchmarks.py | 869 | except ValidationError: | CODE |
| HIGH | pydantic-core/tests/benchmarks/test_micro_benchmarks.py | 886 | except ValidationError: | CODE |
| HIGH | pydantic-core/tests/benchmarks/test_micro_benchmarks.py | 1288 | except ValidationError: | CODE |
| HIGH | pydantic/color.py | 304 | except KeyError: | CODE |
| HIGH | pydantic/fields.py | 803 | except KeyError: | CODE |
| HIGH | pydantic/types.py | 2161 | except ValueError: | CODE |
| HIGH | pydantic/json_schema.py | 3236 | except AttributeError: | CODE |
| HIGH | pydantic/json_schema.py | 1355 | except TypeError: # pragma: no cover | CODE |
| HIGH | pydantic/networks.py | 1231 | except ValueError: | CODE |
| HIGH | pydantic/networks.py | 1270 | except ValueError: | CODE |
| HIGH | pydantic/networks.py | 1311 | except ValueError: | CODE |
| HIGH | pydantic/type_adapter.py | 48 | except KeyError: | CODE |
| HIGH | pydantic/main.py | 1023 | except PydanticUndefinedAnnotation: | CODE |
| HIGH | pydantic/v1/_hypothesis_plugin.py | 54 | except ImportError: # pragma: no cover | CODE |
| HIGH | pydantic/v1/color.py | 234 | except KeyError: | CODE |
| HIGH | pydantic/v1/types.py | 1101 | except ValueError: | CODE |
| HIGH | pydantic/v1/networks.py | 647 | except ValueError: | CODE |
| HIGH | pydantic/v1/networks.py | 671 | except ValueError: | CODE |
| HIGH | pydantic/v1/networks.py | 695 | except ValueError: | CODE |
| HIGH | pydantic/v1/utils.py | 690 | except (TypeError, ValueError, RuntimeError): | CODE |
| HIGH | pydantic/v1/dataclasses.py | 42 | except ImportError: | CODE |
| HIGH | pydantic/v1/typing.py | 184 | except TypeError: # pragma: no cover | CODE |
| HIGH | pydantic/v1/typing.py | 407 | except KeyError: | CODE |
| HIGH | pydantic/v1/typing.py | 425 | except NameError: | CODE |
| HIGH | pydantic/v1/typing.py | 579 | except exc_to_suppress: | CODE |
| HIGH | pydantic/v1/typing.py | 254 | except AttributeError: | CODE |
| HIGH | pydantic/_internal/_docs_extraction.py | 60 | except OSError: # pragma: no cover | CODE |
| HIGH | pydantic/_internal/_docs_extraction.py | 69 | except SyntaxError: | CODE |
| HIGH | pydantic/_internal/_validators.py | 117 | except ImportError: | CODE |
| HIGH | pydantic/_internal/_serializers.py | 45 | except PydanticOmit: # noqa: PERF203 | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1217 | except TypeError: | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 2194 | except AttributeError: | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1163 | except TypeError: | CODE |
| HIGH | pydantic/_internal/_decorators.py | 318 | except AttributeError: | CODE |
| HIGH | pydantic/_internal/_fields.py | 528 | except AttributeError: | CODE |
| HIGH | pydantic/_internal/_generics.py | 460 | except TypeError: # unhashable typevar values | CODE |
| HIGH | pydantic/_internal/_utils.py | 348 | except (TypeError, ValueError, RuntimeError): | CODE |
| HIGH | pydantic/deprecated/copy_internals.py | 72 | except KeyError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/conftest.py | 1 | CODE | |
| LOW | tests/test_types_typeddict.py | 15 | CODE | |
| LOW | tests/test_plugins.py | 1 | CODE | |
| LOW | tests/test_model_validator.py | 1 | CODE | |
| LOW | tests/test_typing.py | 6 | CODE | |
| LOW | tests/test_docs.py | 1 | CODE | |
| LOW | tests/test_docs.py | 42 | CODE | |
| LOW | tests/test_docs.py | 47 | CODE | |
| LOW | tests/test_docs.py | 52 | CODE | |
| LOW | tests/test_schema_gather.py | 3 | CODE | |
| LOW | tests/test_deprecated_validate_arguments.py | 3 | CODE | |
| LOW | tests/test_construction.py | 2 | CODE | |
| LOW | tests/test_pipeline.py | 3 | CODE | |
| LOW | tests/test_titles.py | 14 | CODE | |
| LOW | tests/test_titles.py | 14 | CODE | |
| LOW | tests/types/test_namedtuple.py | 8 | CODE | |
| LOW | tests/mypy/test_mypy.py | 1 | CODE | |
| LOW | tests/mypy/test_mypy.py | 7 | CODE | |
| LOW | tests/mypy/test_mypy.py | 12 | CODE | |
| LOW | tests/mypy/test_mypy.py | 12 | CODE | |
| LOW | tests/mypy/modules/import_cycle_base.py | 13 | CODE | |
| LOW | tests/mypy/modules/create_model_var.py | 1 | CODE | |
| LOW | tests/mypy/outputs/mypy-plugin_ini/create_model_var.py | 1 | CODE | |
| LOW | tests/benchmarks/test_discriminated_unions.py | 1 | CODE | |
| LOW | tests/benchmarks/test_fastapi_startup_generics.py | 3 | CODE | |
| LOW | tests/benchmarks/test_fastapi_startup_simple.py | 3 | CODE | |
| LOW | tests/benchmarks/basemodel_eq_performance.py | 1 | CODE | |
| LOW | tests/benchmarks/basemodel_eq_performance.py | 559 | CODE | |
| LOW | tests/benchmarks/basemodel_eq_performance.py | 560 | CODE | |
| LOW | docs/plugins/conversion_table.py | 1 | CODE | |
| LOW | docs/plugins/algolia.py | 4 | CODE | |
| LOW | docs/plugins/main.py | 1 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 1 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 8 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 31 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 31 | CODE | |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 31 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 6 | CODE | |
| LOW | pydantic-core/tests/conftest.py | 1 | CODE | |
| LOW | pydantic-core/tests/test_typing.py | 1 | CODE | |
| LOW | pydantic-core/tests/serializers/test_union.py | 1 | CODE | |
| 191 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | .github/actions/people/people.py | 364 | Make a GraphQL request to GitHub API. Args: settings: Configuration settings including API token qu | STRING |
| HIGH | pydantic/color.py | 114 | Returns the name of the color if it can be found in `COLORS_BY_VALUE` dictionary, otherwise returns the hexadeci | STRING |
| HIGH | pydantic/color.py | 260 | Parse a tuple or list to get RGBA values. Args: value: A tuple or list. Returns: An `RGBA` tup | STRING |
| HIGH | pydantic/color.py | 282 | Parse a string representing a color to an RGBA tuple. Possible formats for the input string include: * named c | STRING |
| HIGH | pydantic/color.py | 356 | Parse the color value provided and return a number between 0 and 1. Args: value: An integer or string color | STRING |
| HIGH | pydantic/color.py | 383 | Parse an alpha value checking it's a valid float in the range 0 to 1. Args: value: The input value to parse | STRING |
| HIGH | pydantic/color.py | 441 | Converts a float value between 0 and 1 (inclusive) to an integer between 0 and 255 (inclusive). Args: c: Th | STRING |
| HIGH | pydantic/fields.py | 464 | Create a new `FieldInfo` object with the `Field` function. Args: default: The default value for the | STRING |
| HIGH | pydantic/fields.py | 820 | Return a new `FieldInfo` instance from a `dataclasses.Field` instance. Args: dc_field: The `datacla | STRING |
| HIGH | pydantic/fields.py | 1367 | !!! abstract "Usage Documentation" [Fields](../concepts/fields.md) Create a field for objects that can be c | STRING |
| HIGH | pydantic/fields.py | 1693 | !!! abstract "Usage Documentation" [Private Model Attributes](../concepts/models.md#private-model-attributes) | STRING |
| HIGH | pydantic/fields.py | 1881 | !!! abstract "Usage Documentation" [The `computed_field` decorator](../concepts/fields.md#the-computed_field-dec | STRING |
| HIGH | pydantic/json_schema.py | 224 | !!! abstract "Usage Documentation" [Customizing the JSON Schema Generation Process](../concepts/json_schema.md#c | STRING |
| HIGH | pydantic/json_schema.py | 353 | Generates JSON schema definitions from a list of core schemas, pairing the generated definitions with a mapping | STRING |
| HIGH | pydantic/json_schema.py | 400 | Generates a JSON schema for a specified schema in a specified mode. Args: schema: A Pydantic model. | STRING |
| HIGH | pydantic/json_schema.py | 485 | Generate a JSON schema based on the input schema. Args: schema_or_field: The core schema to | STRING |
| HIGH | pydantic/json_schema.py | 1851 | Resolve a JsonSchemaValue to the non-ref schema if it is a $ref schema. Args: json_schema: The sche | STRING |
| HIGH | pydantic/root_model.py | 76 | Create a new model using the provided root object and update fields set. Args: root: The root objec | STRING |
| HIGH | pydantic/type_adapter.py | 230 | Initialize the core schema, validator, and serializer for the type. Args: ns_resolver: The namespac | STRING |
| HIGH | pydantic/type_adapter.py | 375 | Validate a Python object against the model. A [`ValidationError`][pydantic_core.ValidationError] reports the re | STRING |
| HIGH | pydantic/dataclasses.py | 80 | !!! abstract "Usage Documentation" [`dataclasses`](../concepts/dataclasses.md) A decorator used to create a | STRING |
| HIGH | pydantic/main.py | 647 | Compute the class name for parametrizations of generic classes. This method can be overridden to achieve a cust | STRING |
| HIGH | pydantic/main.py | 758 | Validate a pydantic model instance. If validation fails, the resulting [`ValidationError`][pydantic_core.Valida | STRING |
| HIGH | pydantic/main.py | 811 | !!! abstract "Usage Documentation" [JSON Parsing](../concepts/json.md#json-parsing) Validate the gi | STRING |
| HIGH | pydantic/main.py | 1823 | !!! abstract "Usage Documentation" [Dynamic Model Creation](../concepts/models.md#dynamic-model-creation) D | STRING |
| HIGH | pydantic/annotated_handlers.py | 51 | Get the real schema for a `{"$ref": ...}` schema. If the schema given is not a `$ref` schema, it will be returne | STRING |
| HIGH | pydantic/annotated_handlers.py | 101 | Get the real schema for a `definition-ref` schema. If the schema given is not a `definition-ref` schema, it will | STRING |
| HIGH | pydantic/_internal/_schema_generation_shared.py | 41 | Resolves `$ref` in the json schema. This returns the input json schema if there is no `$ref` in json schema. | STRING |
| HIGH | pydantic/_internal/_schema_generation_shared.py | 104 | Resolves reference in the core schema. Args: maybe_ref_schema: The input core schema that may conta | STRING |
| HIGH | pydantic/_internal/_decorators_v1.py | 55 | Wrap a V1 style field validator for V2 compatibility. Args: validator: The V1 style field validator. R | STRING |
| HIGH | pydantic/_internal/_known_annotated_metadata.py | 168 | Apply `annotation` to `schema` if it is an annotation we know about (Gt, Le, etc.). Otherwise return `None`. Th | STRING |
| HIGH | pydantic/_internal/_model_construction.py | 404 | Inspect the namespace prior to class creation. Most of the collected information is then used by `collect_model_fie | STRING |
| HIGH | pydantic/_internal/_model_construction.py | 571 | Finish building a model class. This logic must be called after class has been created since validation functions mu | STRING |
| HIGH | pydantic/_internal/_generate_schema.py | 798 | Generate core schema. Args: obj: The object to generate core schema for. Returns: | STRING |
| HIGH | pydantic/_internal/_discriminated_union.py | 38 | Applies the discriminator and returns a new core schema. Args: schema: The input schema. discrimina | STRING |
| HIGH | pydantic/_internal/_discriminated_union.py | 145 | Return a new CoreSchema based on `schema` that uses a tagged-union with the discriminator provided to this class | STRING |
| HIGH | pydantic/_internal/_decorators.py | 358 | Get the attribute from the next class in the MRO that has it, aiming to simulate calling the method on the actual cl | STRING |
| HIGH | pydantic/_internal/_decorators.py | 393 | Get an attribute out of the `__dict__` following the MRO. This prevents the call to `__get__` on the descriptor, and | STRING |
| HIGH | pydantic/_internal/_fields.py | 284 | Collect the fields, class variables names and private attributes of a nascent Pydantic model. The fields collection | STRING |
| HIGH | pydantic/_internal/_generics.py | 165 | Used inside a function to check whether it was called globally. Args: depth: The depth to get the frame. | STRING |
| HIGH | pydantic/_internal/_dataclasses.py | 93 | Finish building a pydantic dataclass. This logic is called on a class which has already been wrapped in `dataclasse | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH⚡ | tests/test_serialize.py | 246 | assert MyModel(x=None).model_dump_json() == '{"x":null}' | CODE |
| HIGH | tests/test_edge_cases.py | 2229 | '{"v": null}', | CODE |
| HIGH | tests/test_json.py | 328 | == '{"name":"Pumbaa","SSN":234,"birthday":737424000.0,"phone":18007267864,"friend":null}' | CODE |
| HIGH | tests/test_types.py | 767 | Foobar.model_validate_json('{"password": 1234, "empty_password": null}') | CODE |
| HIGH | tests/test_types.py | 2439 | assert Model().model_dump_json() == '{"f":null}' | CODE |
| HIGH | tests/types/test_dict.py | 46 | assert ta.validate_json('{"1": 1, "2": "a", "3": null}') == {'1': 1, '2': 'a', '3': None} | CODE |
| HIGH | pydantic-core/tests/serializers/test_model.py | 315 | assert s.to_json(BasicModel(foo=None, bar=b'more')) == b'{"foo":null,"bar":"more"}' | CODE |
| HIGH | pydantic-core/tests/serializers/test_model.py | 827 | s.to_json(Model(3, 4), exclude_none=False, by_alias=True) == b'{"width":3,"height":4,"Area":12,"volume":null}' | CODE |
| HIGH | pydantic-core/tests/serializers/test_model.py | 883 | s.to_json(Model(3, 4), exclude_none=False, by_alias=True) == b'{"width":3,"height":4,"volume":null,"Area":12}' | CODE |
| HIGH | pydantic-core/tests/serializers/test_model.py | 1090 | assert s.to_json(m) == b'{"field_a":"test","field_b":12,"field_c":null,"field_d":[1,2,3]}' | CODE |
| HIGH | pydantic-core/tests/serializers/test_model.py | 1104 | assert s.to_json(m, exclude={'field_d': [0]}) == b'{"field_a":"test","field_b":12,"field_c":null,"field_d":[2,3]}' | CODE |
| HIGH | pydantic-core/tests/serializers/test_typed_dict.py | 156 | assert v.to_json({'foo': 1, 'bar': b'more', 'c': None}) == b'{"foo":1,"bar":"more","c":null}' | CODE |
| HIGH | pydantic-core/tests/serializers/test_typed_dict.py | 157 | assert v.to_json({'foo': None, 'bar': b'more'}) == b'{"foo":null,"bar":"more"}' | CODE |
| HIGH | pydantic-core/tests/serializers/test_any.py | 661 | assert s.to_json([inf]) == b'[null]' | CODE |
| HIGH | pydantic-core/tests/serializers/test_any.py | 664 | assert s.to_json([nan]) == b'[null]' | CODE |
| HIGH | pydantic-core/tests/serializers/test_json.py | 23 | assert s.to_json(v) == b'["a",[1,2],null]' | CODE |
| HIGH | pydantic/json_schema.py | 1618 | with self._config_wrapper_stack.push(config): | CODE |
| HIGH | pydantic/json_schema.py | 1762 | with self._config_wrapper_stack.push(config): | CODE |
| HIGH | pydantic/json_schema.py | 1974 | with self._config_wrapper_stack.push(config): | CODE |
| HIGH | pydantic/type_adapter.py | 707 | with schema_generator_instance._config_wrapper_stack.push(self._config): | CODE |
| HIGH | pydantic/_internal/_typing_extra.py | 263 | with ns_resolver.push(base): | CODE |
| HIGH | pydantic/_internal/_typing_extra.py | 317 | with ns_resolver.push(base): | CODE |
| HIGH | pydantic/_internal/_namespace_utils.py | 208 | with ns_resolver.push(Model): | STRING |
| HIGH | pydantic/_internal/_namespace_utils.py | 215 | with ns_resolver.push(Sub): | STRING |
| HIGH | pydantic/_internal/_generate_schema.py | 860 | with self._config_wrapper_stack.push(config_wrapper), self._ns_resolver.push(cls): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1126 | with self.model_type_stack.push(obj): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1310 | with self.field_name_stack.push(name): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1399 | with self._ns_resolver.push(origin): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1437 | self.model_type_stack.push(typed_dict_cls), | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1460 | with self._config_wrapper_stack.push(config): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1569 | self.model_type_stack.push(namedtuple_cls), | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1625 | with self.field_name_stack.push(name): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1667 | with self.field_name_stack.push(name): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1717 | with self.field_name_stack.push(name): | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1906 | self.model_type_stack.push(dataclass), | CODE |
| HIGH | pydantic/_internal/_generate_schema.py | 1933 | with self._ns_resolver.push(dataclass), self._config_wrapper_stack.push(config): | CODE |
| HIGH | pydantic/_internal/_fields.py | 606 | with ns_resolver.push(cls): | CODE |
| HIGH | pydantic/_internal/_fields.py | 714 | with ns_resolver.push(base): | CODE |
| HIGH | pydantic/_internal/_fields.py | 811 | with ns_resolver.push(cls): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | README.md | 50 | name: str = 'John Doe' | CODE |
| LOW | README.md | 57 | #> User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3] | COMMENT |
| LOW | tests/test_types_typeddict.py | 978 | m = Model.model_validate({'a': {'name': 'John Doe', 'extra': 'something'}}) | CODE |
| LOW | tests/test_types_typeddict.py | 980 | assert m.model_dump() == {'a': {'name': 'John Doe', 'extra': 'something'}} | CODE |
| LOW | tests/test_rich_repr.py | 13 | name: str = 'John Doe' | CODE |
| LOW | tests/test_rich_repr.py | 26 | ('name', 'John Doe'), | CODE |
| LOW⚡ | tests/test_dataclasses.py | 561 | name: str = 'John Doe' | CODE |
| LOW⚡ | tests/test_dataclasses.py | 570 | assert fields['name'].default == 'John Doe' | CODE |
| LOW | tests/test_dataclasses.py | 614 | name: str = 'John Doe' | CODE |
| LOW | tests/test_dataclasses.py | 642 | 'name': {'default': 'John Doe', 'title': 'Name', 'type': 'string'}, | CODE |
| LOW⚡ | tests/test_config.py | 124 | ('id: int = 1', 'bar=2', 'baz: Any', "name: str = 'John Doe'", 'foo: str', '**data'), | CODE |
| LOW⚡ | tests/test_config.py | 126 | assert _equals(str(sig), "(id: int = 1, bar=2, *, baz: Any, name: str = 'John Doe', foo: str, **data) -> None") | CODE |
| LOW | tests/test_config.py | 111 | name: str = 'John Doe' | CODE |
| LOW | tests/test_networks.py | 236 | url = validate_url('http://user:@example.org') | CODE |
| LOW | tests/test_networks.py | 243 | url = validate_url('http://:password@example.org') | CODE |
| LOW⚡ | tests/test_edge_cases.py | 2329 | assert module.User(id=12).model_dump() == {'id': 12, 'name': 'Jane Doe'} | CODE |
| LOW | tests/test_edge_cases.py | 2802 | data = {'age': 'John Doe'} | CODE |
| LOW⚡ | tests/test_edge_cases.py | 2322 | name: str = 'Jane Doe' | STRING |
| LOW | tests/test_json_schema.py | 6730 | b: Annotated[int, 'placeholder'] = ... | CODE |
| LOW⚡ | tests/test_model_signature.py | 66 | ('id: int = 1', 'bar=2', 'baz: Any', "name: str = 'John Doe'", 'foo: str', '**data'), | CODE |
| LOW⚡ | tests/test_model_signature.py | 69 | assert _equals(str(sig), "(id: int = 1, bar=2, *, baz: Any, name: str = 'John Doe', foo: str, **data) -> None") | CODE |
| LOW | tests/test_model_signature.py | 53 | name: str = 'John Doe' | CODE |
| LOW | tests/test_types.py | 2275 | assert Foo(baz=' uSeR@ExAmPlE.com ').baz == 'user@example.com' | CODE |
| LOW | docs/index.md | 63 | name: str = 'John Doe' # (2)! | CODE |
| LOW | docs/index.md | 86 | 'name': 'John Doe', | STRING |
| LOW | docs/index.md | 120 | name: str = 'John Doe' | CODE |
| LOW | docs/plugins/devtools_output.html | 22 | user: id=123 name='John Doe' signup_ts=datetime.datetime(2019, 6, 1, 12, 22) friends=[1234, 4567, 7890] address=Address( | CODE |
| LOW | docs/integrations/devtools.md | 38 | name='John Doe', | CODE |
| LOW⚡ | docs/examples/queues.md | 38 | user1 = User(id=1, name='John Doe', email='john@example.com') | CODE |
| LOW⚡ | docs/examples/queues.md | 39 | user2 = User(id=2, name='Jane Doe', email='jane@example.com') | CODE |
| LOW⚡ | docs/examples/queues.md | 42 | #> Added to queue: {"id":1,"name":"John Doe","email":"john@example.com"} | COMMENT |
| LOW⚡ | docs/examples/queues.md | 45 | #> Added to queue: {"id":2,"name":"Jane Doe","email":"jane@example.com"} | COMMENT |
| LOW | docs/examples/queues.md | 59 | #> Validated user: User(id=1, name='John Doe', email='john@example.com') | COMMENT |
| LOW | docs/examples/queues.md | 62 | #> Validated user: User(id=2, name='Jane Doe', email='jane@example.com') | COMMENT |
| LOW⚡ | docs/examples/queues.md | 109 | user1 = User(id=1, name='John Doe', email='john@example.com') | CODE |
| LOW⚡ | docs/examples/queues.md | 110 | user2 = User(id=2, name='Jane Doe', email='jane@example.com') | CODE |
| LOW⚡ | docs/examples/queues.md | 113 | #> Added to queue: {"id":1,"name":"John Doe","email":"john@example.com"} | COMMENT |
| LOW⚡ | docs/examples/queues.md | 116 | #> Added to queue: {"id":2,"name":"Jane Doe","email":"jane@example.com"} | COMMENT |
| LOW | docs/examples/queues.md | 218 | user1 = User(id=1, name='John Doe', email='john@example.com') | CODE |
| LOW | docs/examples/queues.md | 219 | user2 = User(id=2, name='Jane Doe', email='jane@example.com') | CODE |
| LOW | docs/examples/files.md | 16 | "name": "John Doe", | CODE |
| LOW | docs/examples/files.md | 39 | #> name='John Doe' age=30 email='john@example.com' | COMMENT |
| LOW | docs/examples/files.md | 97 | "name": "John Doe", | CODE |
| LOW | docs/examples/files.md | 102 | "name": "Jane Doe", | CODE |
| LOW | docs/examples/files.md | 128 | #> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com') | COMMENT |
| LOW | docs/examples/files.md | 128 | #> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com') | COMMENT |
| LOW | docs/examples/files.md | 147 | {"name": "John Doe", "age": 30, "email": "john@example.com"} | CODE |
| LOW | docs/examples/files.md | 148 | {"name": "Jane Doe", "age": 25, "email": "jane@example.com"} | CODE |
| LOW | docs/examples/files.md | 168 | #> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com') | COMMENT |
| LOW | docs/examples/files.md | 168 | #> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com') | COMMENT |
| LOW⚡ | docs/examples/files.md | 204 | #> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com') | COMMENT |
| LOW⚡ | docs/examples/files.md | 204 | #> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com') | COMMENT |
| LOW⚡ | docs/examples/files.md | 214 | name = "John Doe" | CODE |
| LOW | docs/examples/files.md | 238 | #> name='John Doe' age=30 email='john@example.com' | COMMENT |
| LOW | docs/examples/files.md | 272 | #> name='John Doe' age=30 email='john@example.com' | COMMENT |
| LOW | docs/examples/files.md | 308 | #> name='John Doe' age=30 email='john@example.com' | COMMENT |
| LOW | docs/examples/files.md | 342 | #> name='John Doe' age=30 email='john@example.com' | COMMENT |
| LOW | docs/concepts/json_schema.md | 926 | 'name': 'John Doe', | CODE |
| LOW | docs/concepts/json_schema.md | 940 | "name": "John Doe" | STRING |
| LOW⚡ | docs/concepts/unions.md | 152 | user_01 = User(id=123, name='John Doe') | CODE |
| 42 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_exports.py | 33 | CODE | |
| LOW | tests/test_exports.py | 39 | CODE | |
| LOW | tests/test_docs.py | 86 | CODE | |
| LOW | docs/plugins/main.py | 54 | CODE | |
| LOW | pydantic-core/wasm-preview/run_tests.py | 18 | CODE | |
| LOW | pydantic-core/tests/conftest.py | 69 | CODE | |
| LOW | pydantic-core/tests/conftest.py | 131 | CODE | |
| LOW | pydantic-core/tests/test_errors.py | 713 | CODE | |
| LOW | pydantic-core/tests/validators/test_string.py | 351 | CODE | |
| LOW | pydantic-core/tests/validators/test_url.py | 71 | CODE | |
| LOW | pydantic-core/tests/validators/test_url.py | 485 | CODE | |
| LOW | pydantic-core/tests/validators/test_url.py | 1005 | CODE | |
| LOW | pydantic-core/tests/validators/test_url.py | 1061 | CODE | |
| LOW | .github/actions/people/people.py | 451 | CODE | |
| LOW | .github/actions/people/people.py | 497 | CODE | |
| LOW | .github/actions/people/people.py | 581 | CODE | |
| LOW | pydantic/fields.py | 652 | CODE | |
| LOW | pydantic/fields.py | 753 | CODE | |
| LOW | pydantic/fields.py | 1012 | CODE | |
| LOW | pydantic/mypy.py | 191 | CODE | |
| LOW | pydantic/mypy.py | 374 | CODE | |
| LOW | pydantic/mypy.py | 595 | CODE | |
| LOW | pydantic/mypy.py | 931 | CODE | |
| LOW | pydantic/mypy.py | 1034 | CODE | |
| LOW | pydantic/mypy.py | 1059 | CODE | |
| LOW | pydantic/mypy.py | 1117 | CODE | |
| LOW | pydantic/types.py | 3117 | CODE | |
| LOW | pydantic/types.py | 1030 | CODE | |
| LOW | pydantic/json_schema.py | 3136 | CODE | |
| LOW | pydantic/json_schema.py | 200 | CODE | |
| LOW | pydantic/json_schema.py | 902 | CODE | |
| LOW | pydantic/json_schema.py | 961 | CODE | |
| LOW | pydantic/json_schema.py | 1462 | CODE | |
| LOW | pydantic/json_schema.py | 1505 | CODE | |
| LOW | pydantic/json_schema.py | 1599 | CODE | |
| LOW | pydantic/json_schema.py | 1683 | CODE | |
| LOW | pydantic/json_schema.py | 2623 | CODE | |
| LOW | pydantic/json_schema.py | 2627 | CODE | |
| LOW | pydantic/main.py | 334 | CODE | |
| LOW | pydantic/main.py | 410 | CODE | |
| LOW | pydantic/main.py | 1460 | CODE | |
| LOW | pydantic/main.py | 1115 | CODE | |
| LOW | pydantic/v1/_hypothesis_plugin.py | 356 | CODE | |
| LOW | pydantic/v1/fields.py | 197 | CODE | |
| LOW | pydantic/v1/fields.py | 581 | CODE | |
| LOW | pydantic/v1/fields.py | 850 | CODE | |
| LOW | pydantic/v1/fields.py | 898 | CODE | |
| LOW | pydantic/v1/fields.py | 1000 | CODE | |
| LOW | pydantic/v1/fields.py | 1053 | CODE | |
| LOW | pydantic/v1/fields.py | 1171 | CODE | |
| LOW | pydantic/v1/decorator.py | 61 | CODE | |
| LOW | pydantic/v1/decorator.py | 179 | CODE | |
| LOW | pydantic/v1/validators.py | 81 | CODE | |
| LOW | pydantic/v1/validators.py | 316 | CODE | |
| LOW | pydantic/v1/validators.py | 699 | CODE | |
| LOW | pydantic/v1/env_settings.py | 166 | CODE | |
| LOW | pydantic/v1/env_settings.py | 281 | CODE | |
| LOW | pydantic/v1/env_settings.py | 94 | CODE | |
| LOW | pydantic/v1/mypy.py | 171 | CODE | |
| LOW | pydantic/v1/mypy.py | 344 | CODE | |
| 66 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_aliases.py | 0 | this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take p | STRING |
| HIGH | pydantic-core/tests/validators/test_typed_dict.py | 0 | this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take p | STRING |
| HIGH | pydantic-core/tests/validators/test_dataclasses.py | 0 | this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take p | STRING |
| HIGH | pydantic-core/tests/validators/test_model_fields.py | 0 | this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take p | STRING |
| HIGH | pydantic-core/tests/validators/test_arguments.py | 0 | this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take p | STRING |
| HIGH | …antic-core/tests/validators/arguments_v3/test_alias.py | 0 | this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take p | STRING |
| HIGH | tests/mypy/modules/decorator_implicit_classmethod.py | 0 | test that the mypy plugin implicitly transforms the right decorators into class methods. | STRING |
| HIGH | …yproject-plugin_toml/decorator_implicit_classmethod.py | 0 | test that the mypy plugin implicitly transforms the right decorators into class methods. | STRING |
| HIGH | …puts/mypy-plugin_ini/decorator_implicit_classmethod.py | 0 | test that the mypy plugin implicitly transforms the right decorators into class methods. | STRING |
| HIGH | pydantic-core/tests/serializers/test_model.py | 0 | this test reflects the priority that applies for config vs runtime serialization alias configuration. if the runtime val | STRING |
| HIGH | pydantic-core/tests/serializers/test_typed_dict.py | 0 | this test reflects the priority that applies for config vs runtime serialization alias configuration. if the runtime val | STRING |
| HIGH | pydantic-core/tests/serializers/test_dataclasses.py | 0 | this test reflects the priority that applies for config vs runtime serialization alias configuration. if the runtime val | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/typechecking/decorators.py | 209 | CODE | |
| LOW | tests/typechecking/decorators.py | 214 | CODE | |
| LOW | tests/typechecking/decorators.py | 219 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 656 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 718 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 785 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 856 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 964 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1094 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1160 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1230 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1304 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1718 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1775 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1932 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 1995 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 2054 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 2187 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 2250 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 2318 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 2385 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3050 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3161 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3226 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3540 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3670 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3745 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3845 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 3983 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 4201 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 4561 | CODE | |
| LOW | pydantic-core/python/pydantic_core/core_schema.py | 4630 | CODE | |
| LOW | pydantic-core/tests/validators/test_model.py | 230 | CODE | |
| LOW | pydantic/fields.py | 1083 | CODE | |
| LOW | pydantic/fields.py | 1123 | CODE | |
| LOW | pydantic/fields.py | 1163 | CODE | |
| LOW | pydantic/fields.py | 1206 | CODE | |
| LOW | pydantic/fields.py | 1246 | CODE | |
| LOW | pydantic/fields.py | 1289 | CODE | |
| LOW | pydantic/fields.py | 1327 | CODE | |
| LOW | pydantic/fields.py | 1849 | CODE | |
| LOW | pydantic/fields.py | 1865 | CODE | |
| LOW | pydantic/fields.py | 220 | CODE | |
| LOW | pydantic/mypy.py | 1264 | CODE | |
| LOW | pydantic/types.py | 759 | CODE | |
| LOW | pydantic/types.py | 1053 | CODE | |
| LOW | pydantic/networks.py | 516 | CODE | |
| LOW | pydantic/root_model.py | 128 | CODE | |
| LOW | pydantic/type_adapter.py | 535 | CODE | |
| LOW | pydantic/type_adapter.py | 599 | CODE | |
| LOW | pydantic/dataclasses.py | 33 | CODE | |
| LOW | pydantic/dataclasses.py | 51 | CODE | |
| LOW | pydantic/dataclasses.py | 66 | CODE | |
| LOW | pydantic/main.py | 1776 | CODE | |
| LOW | pydantic/main.py | 1809 | CODE | |
| LOW | pydantic/main.py | 472 | CODE | |
| LOW | pydantic/main.py | 538 | CODE | |
| LOW | pydantic/main.py | 1411 | CODE | |
| LOW | pydantic/v1/fields.py | 221 | CODE | |
| LOW | pydantic/v1/types.py | 449 | CODE | |
| 7 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test_dataclasses.py | 3286 | def update_schema(schema: dict[str, Any]) -> None: | CODE |
| LOW | release/prepare.py | 23 | def update_version(new_version: str, dry_run: bool) -> None: | CODE |
| LOW | release/prepare.py | 100 | def update_history(new_version: str, dry_run: bool, force_update: bool) -> None: | CODE |
| LOW | pydantic-core/python/pydantic_core/__init__.py | 43 | __all__ = [ | CODE |
| LOW | pydantic/fields.py | 1787 | def _update_from_config(self, config_wrapper: ConfigWrapper, name: str) -> None: | CODE |
| LOW | pydantic/mypy.py | 1034 | def set_frozen(self, fields: list[PydanticModelField], api: SemanticAnalyzerPluginInterface, frozen: bool) -> None: | CODE |
| LOW | pydantic/json_schema.py | 1769 | def _update_class_schema(self, json_schema: JsonSchemaValue, cls: type[Any], config: ConfigDict) -> None: | CODE |
| LOW | pydantic/networks.py | 73 | __all__ = [ | CODE |
| LOW | pydantic/main.py | 1696 | def update_forward_refs(cls, **localns: Any) -> None: # noqa: D102 | CODE |
| LOW | pydantic/v1/fields.py | 197 | def update_from_config(self, from_config: Dict[str, Any]) -> None: | CODE |
| LOW | pydantic/v1/fields.py | 516 | def set_config(self, config: Type['BaseConfig']) -> None: | CODE |
| LOW | pydantic/v1/fields.py | 557 | def _set_default_and_type(self) -> None: | CODE |
| LOW | pydantic/v1/__init__.py | 22 | __all__ = [ | CODE |
| LOW | pydantic/v1/mypy.py | 539 | def set_frozen(self, fields: List['PydanticModelField'], frozen: bool) -> None: | CODE |
| LOW | pydantic/v1/types.py | 58 | __all__ = [ | CODE |
| LOW | pydantic/v1/networks.py | 72 | __all__ = [ | CODE |
| LOW | pydantic/v1/utils.py | 225 | def update_not_none(mapping: Dict[Any, Any], **update: Any) -> None: | CODE |
| LOW | pydantic/v1/dataclasses.py | 92 | __all__ = [ | CODE |
| LOW | pydantic/v1/typing.py | 537 | def update_field_forward_refs(field: 'ModelField', globalns: Any, localns: Any) -> None: | CODE |
| LOW | pydantic/v1/main.py | 833 | def update_forward_refs(cls, **localns: Any) -> None: | CODE |
| LOW | pydantic/_internal/_model_construction.py | 499 | def set_default_hash_func(cls: type[BaseModel], bases: tuple[type[Any], ...]) -> None: | CODE |
| LOW | pydantic/_internal/_model_construction.py | 685 | def set_deprecated_descriptors(cls: type[BaseModel]) -> None: | CODE |
| LOW | pydantic/_internal/_schema_gather.py | 8 | __all__ = [ | CODE |
| LOW | pydantic/_internal/_discriminated_union.py | 28 | def set_discriminator_in_metadata(schema: CoreSchema, discriminator: Any) -> None: | CODE |
| LOW | pydantic/_internal/_discriminated_union.py | 494 | def _set_unique_choice_for_values(self, choice: core_schema.CoreSchema, values: list[Any]) -> None: | CODE |
| LOW | pydantic/_internal/_decorators.py | 522 | def update_from_config(self, config_wrapper: ConfigWrapper) -> None: | CODE |
| LOW⚡ | pydantic/_internal/_fields.py | 152 | def _update_fields_from_docstrings(cls: type[Any], fields: dict[str, FieldInfo], use_inspect: bool = False) -> None: | CODE |
| LOW | pydantic/_internal/_fields.py | 222 | def update_field_from_config(config_wrapper: ConfigWrapper, field_name: str, field_info: FieldInfo) -> None: | CODE |
| LOW | pydantic/_internal/_mock_val_ser.py | 117 | def set_type_adapter_mocks(adapter: TypeAdapter) -> None: | CODE |
| LOW | pydantic/_internal/_mock_val_ser.py | 156 | def set_model_mocks(cls: type[BaseModel], undefined_name: str | None = None) -> None: | CODE |
| LOW | pydantic/_internal/_mock_val_ser.py | 197 | def set_dataclass_mocks(cls: type[PydanticDataclass], undefined_name: str | None = None) -> None: | CODE |
| LOW | pydantic/_internal/_utils.py | 142 | def update_not_none(mapping: dict[Any, Any], **update: Any) -> None: | CODE |
| LOW | pydantic/experimental/pipeline.py | 27 | __all__ = ['validate_as', 'validate_as_deferred', 'transform'] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_validators.py | 3135 | ) # Create a Sub instance without triggering validation (e.g., using model_construct) | CODE |
| MEDIUM | tests/test_main.py | 3160 | # Defining a nested type does not error | COMMENT |
| MEDIUM⚡ | tests/test_types.py | 2104 | # Create a module that exists, but fails to import due to missing dependency | COMMENT |
| MEDIUM | pydantic/types.py | 997 | # Create an instance | STRING |
| MEDIUM | pydantic/json_schema.py | 102 | """This class is used to emit warnings produced during JSON schema generation. | STRING |
| MEDIUM | pydantic/json_schema.py | 2669 | """This method is responsible for ignoring warnings as desired, and for formatting the warning messages. | STRING |
| MEDIUM | pydantic/functional_serializers.py | 150 | """This method is used to get the Pydantic core schema of the class. | STRING |
| MEDIUM | pydantic/_internal/_model_construction.py | 362 | """This function is meant to behave like a BaseModel method to initialize private attributes. | STRING |
| MEDIUM | pydantic/_internal/_generate_schema.py | 2234 | # Create a new ComputedFieldInfo so that different type parametrizations of the same | COMMENT |
| MEDIUM | pydantic/_internal/_discriminated_union.py | 73 | """This class is used to convert an input schema containing a union schema into one where that union is | STRING |
| MEDIUM | pydantic/_internal/_decorators.py | 804 | # Define the types we want to check against as a single tuple. | COMMENT |
| MEDIUM | pydantic/plugin/__init__.py | 51 | """This method is called for each plugin every time a new [`SchemaValidator`][pydantic_core.SchemaValidator] | STRING |
| MEDIUM | pydantic/deprecated/config.py | 31 | """This class is only retained for backwards compatibility. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_edge_cases.py | 1161 | assert exc_info.value.errors(include_url=False) == [ | COMMENT |
| LOW | tests/test_edge_cases.py | 1181 | COMMENT | |
| LOW | …sts/mypy/outputs/pyproject-default_toml/root_models.py | 61 | # MYPY: error: Argument "m1" to "Model" has incompatible type "int"; expected "Maybe[int]" [arg-type] | COMMENT |
| LOW | tests/mypy/outputs/mypy-default_ini/root_models.py | 61 | # MYPY: error: Argument "m1" to "Model" has incompatible type "int"; expected "Maybe[int]" [arg-type] | COMMENT |
| LOW | pydantic-core/tests/test.rs | 1 | #[cfg(test)] | COMMENT |
| LOW | pydantic-core/src/schema_gather.rs | 241 | /// Context instances should only be used during schema traversing. | COMMENT |
| LOW | pydantic-core/src/schema_gather.rs | 261 | /// Core schemas are stored (and thus shared) on successfully completed Pydantic models (and other | COMMENT |
| LOW | pydantic-core/src/definitions.rs | 21 | COMMENT | |
| LOW | pydantic-core/src/validators/decimal.rs | 141 | break; | COMMENT |
| LOW | pydantic-core/src/validators/validation_state.rs | 21 | pub struct ValidationState<'a, 'py> { | COMMENT |
| LOW | pydantic-core/src/errors/location.rs | 81 | } | COMMENT |
| LOW | .github/workflows/docs-navigation.yml | 1 | name: Docs Navigation Check | COMMENT |
| LOW | .github/workflows/third-party.yml | 1 | # This workflow runs on pull requests labeled with `third-party-tests`, inspired by: | COMMENT |
| LOW | pydantic/main.py | 1261 | # Resort to costly filtering of the __dict__ objects | COMMENT |
| LOW | pydantic/v1/_hypothesis_plugin.py | 41 | # them on-disk, and that's unsafe in general without being told *where* to do so. | COMMENT |
| LOW | pydantic/v1/generics.py | 221 | if not issubclass(base_model, GenericModel): | COMMENT |
| LOW | pydantic/_internal/_namespace_utils.py | 241 | if not self._types_stack: | COMMENT |
| LOW | pydantic/_internal/_discriminated_union.py | 81 | I have chosen to implement the conversion algorithm in this class, rather than a function, | COMMENT |
| LOW | pydantic/_internal/_discriminated_union.py | 101 | # debugging challenges for users making subtle mistakes. | COMMENT |
| LOW | pydantic/_internal/_discriminated_union.py | 121 | # the final value in another nullable schema. | COMMENT |
| LOW | pydantic/_internal/_generics.py | 121 | """ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_dataclasses.py | 2271 | # for standard dataclasses, so we just use TypeAdapter to get validation for each. | COMMENT |
| MEDIUM | tests/test_edge_cases.py | 2242 | """This is primarily included in order to document the behavior / limitations of the `Hashable` type's validation lo | STRING |
| LOW | pydantic-core/tests/serializers/test_any.py | 349 | # because when recursion is detected and we're in mode python, we just return the value | COMMENT |
| LOW | pydantic-core/tests/serializers/test_any.py | 384 | # when recursion is detected and we're in mode python, we just return the value | COMMENT |
| LOW | pydantic/functional_validators.py | 277 | # we don't want to bother with further validation, just return the new value | STRING |
| LOW | pydantic/types.py | 1758 | # hence we just use `secret_display` | COMMENT |
| MEDIUM | pydantic/json_schema.py | 3149 | # for instance when "examples" is used as a property key. A more robust solution | COMMENT |
| LOW | pydantic/json_schema.py | 461 | # If a schema with the same CoreRef has been handled, just return a reference to it | COMMENT |
| LOW | pydantic/main.py | 1255 | # early if there are no keys to ignore (we would just return False later on anyway) | COMMENT |
| LOW | pydantic/v1/error_wrappers.py | 46 | # but recursive, therefore just use: | COMMENT |
| MEDIUM | pydantic/_internal/_docs_extraction.py | 97 | # making it way more robust. | COMMENT |
| LOW | pydantic/_internal/_validators.py | 74 | # otherwise we just return the value and let the next validator do the rest of the work | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_config.py | 460 | def my_function(): | STRING |
| LOW | tests/test_config.py | 486 | def my_function(): | STRING |
| LOW⚡ | tests/test_types.py | 1597 | def my_function(y: type_hint): | CODE |
| LOW | tests/types/unions/test_union.py | 326 | def do_something(self): | CODE |
| LOW | tests/types/unions/test_union.py | 335 | def do_something(self): | CODE |
| LOW | pydantic-core/tests/test_errors.py | 87 | def my_function(input_value, info): | CODE |
| LOW | pydantic-core/tests/validators/test_function.py | 65 | def my_function(input_value, info): | CODE |
| LOW | pydantic-core/tests/validators/test_function.py | 100 | def my_function(input_value, info): | CODE |
| LOW | pydantic-core/tests/validators/test_call.py | 26 | def my_function(a, b, c): | CODE |
| LOW | pydantic-core/tests/validators/test_call.py | 69 | def my_function(a, b, c): | CODE |
| LOW | pydantic-core/tests/validators/test_call.py | 83 | def my_function(a): | CODE |
| LOW | pydantic-core/tests/validators/test_call.py | 93 | def my_function(a): | CODE |
| LOW | pydantic-core/tests/validators/test_call.py | 177 | def my_function(a, b, c): | CODE |
| LOW | pydantic-core/tests/validators/test_call.py | 197 | def my_function(a): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | pydantic-core/wasm-preview/worker.js | 28 | print(tty); | CODE |
| HIGH | pydantic-core/wasm-preview/worker.js | 32 | print(tty); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | pydantic/v1/mypy.py | 334 | for name, sym in self._ctx.cls.info.names.items(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/mypy/test_mypy.py | 229 | except Exception: | CODE |
| LOW | pydantic-core/wasm-preview/run_tests.py | 63 | except Exception: | CODE |
| LOW | pydantic/json_schema.py | 1337 | except Exception: | CODE |
| LOW | pydantic/json_schema.py | 2561 | except Exception as e: | CODE |
| LOW | pydantic/v1/_hypothesis_plugin.py | 226 | except Exception: # pragma: no cover | CODE |
| LOW | pydantic/_internal/_type_refs.py | 99 | except Exception: | CODE |
| LOW | pydantic/_internal/_typing_extra.py | 277 | except Exception: | CODE |
| LOW | pydantic/plugin/_schema_validator.py | 128 | except Exception as exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | pydantic/v1/mypy.py | 557 | # I don't know whether it's possible to hit this branch, but I've added it for safety | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_deprecated.py | 574 | CODE |