AI Slop Code RIsk Monitor

pydantic/pydantic

Data validation using Python type hints

15.6 Elevated pattern signal View on GitHub

Maintenance and Governance Review

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.

15.6
Adjusted Signal
15.6
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
29.0K
Stars
Python
Language
251.4K
Lines of Code
771
Files
3.8K
Pattern Hits
2026-10-12
Scan Date
0.19
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 45.0/100 · MEDIUM

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

Hallucinated Dependency & Supply Chain Risk 10.7/100 · LOW

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

Agent Over-Engineering Ratio 44.5/100 · MEDIUM

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

PR Review Velocity Impact 59.6/100 · HIGH

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

What These Metrics Mean

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

Pattern-Signal History

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

Severity Breakdown

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

CRITICAL 1HIGH 144MEDIUM 17LOW 3637

Directory Score Breakdown

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

Pattern Findings

The scanner identified 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.

Hyper-Verbose Identifiers3006 hits · 2562 pts
SeverityFileLineSnippetContext
LOWtests/test_assert_in_validators.py23def test_assert_raises_validation_error():CODE
LOWtests/test_freethreaded.py38def test_typed_dict_concurrent_type_adapter() -> None:CODE
LOWtests/test_freethreaded.py51def test_base_model_concurrent_creation_with_shared_base() -> None:CODE
LOWtests/test_freethreaded.py82def test_dataclass_concurrent_creation_with_shared_base() -> None:CODE
LOWtests/test_freethreaded.py114def test_model_rebuild_concurrent_subclass_creation(monkeypatch: pytest.MonkeyPatch) -> None:CODE
LOWtests/test_freethreaded.py146def test_model_force_rebuild_concurrent_instantiation() -> None:CODE
LOWtests/test_dunder_all.py13def test_explicit_reexports_exist() -> None:CODE
LOW⚡tests/test_version.py31def test_version_attribute_is_present():CODE
LOW⚡tests/test_version.py35def test_version_attribute_is_a_string():CODE
LOW⚡tests/test_version.py39def test_check_pydantic_core_version() -> None:CODE
LOWtests/test_computed_fields.py69def test_computed_fields_json_schema():CODE
LOWtests/test_computed_fields.py217def test_properties_and_computed_fields():CODE
LOWtests/test_computed_fields.py244def test_computed_fields_repr():CODE
LOWtests/test_computed_fields.py426def test_private_computed_field():CODE
LOWtests/test_computed_fields.py546def test_abstractmethod_missing(bases: tuple[Any, ...]):CODE
LOW⚡tests/test_computed_fields.py567 def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:CODE
LOW⚡tests/test_computed_fields.py573def test_computed_fields_infer_return_type():CODE
LOW⚡tests/test_computed_fields.py583def test_computed_fields_missing_return_type():CODE
LOWtests/test_computed_fields.py611 def my_aliased_computed_field_none(self) -> int:CODE
LOWtests/test_computed_fields.py660def test_alias_generator_defer_build() -> None:CODE
LOWtests/test_computed_fields.py740def test_multiple_references_to_schema(model_factory: Callable[[], Any]) -> None:CODE
LOWtests/test_computed_fields.py765def test_generic_computed_field():CODE
LOWtests/test_computed_fields.py796def test_computed_field_override_raises():CODE
LOWtests/test_computed_fields.py812def test_computed_field_excluded_from_model_dump_recursive() -> None:CODE
LOWtests/test_computed_fields.py828def test_computed_field_with_field_serializer():CODE
LOWtests/test_computed_fields.py844def test_computed_fields_exclude() -> None:CODE
LOWtests/test_computed_fields.py859def test_computed_fields_serialization_exclude_if() -> None:CODE
LOWtests/test_computed_fields.py881def test_computed_fields_serialization_exclude_if_from_annotated() -> None:CODE
LOWtests/test_lazy_imports.py33def test_lazy_import_in_annotation(create_module) -> None:CODE
LOWtests/test_lazy_imports.py49def test_lazy_import_circular_models(import_lazy_modules) -> None:STRING
LOWtests/test_lazy_imports.py86def test_lazy_import_circular_dataclasses(import_lazy_modules) -> None:STRING
LOWtests/test_lazy_imports.py117def test_lazy_import_missing_module(create_module) -> None:STRING
LOWtests/test_lazy_imports.py146def test_lazy_import_missing_name(create_module) -> None:STRING
LOWtests/test_v1.py34def test_isinstance_does_not_raise_deprecation_warnings():CODE
LOWtests/test_utils.py39def test_import_module_invalid():CODE
LOWtests/test_utils.py94def test_lenient_issubclass_with_generic_aliases():CODE
LOWtests/test_utils.py101def test_lenient_issubclass_is_lenient():CODE
LOWtests/test_utils.py318def test_deep_update_is_not_mutating():CODE
LOW⚡tests/test_utils.py364def test_smart_deepcopy_immutable_non_sequence(obj, mocker):CODE
LOW⚡tests/test_utils.py372def test_smart_deepcopy_empty_collection(empty_collection, mocker):CODE
LOW⚡tests/test_utils.py382def test_smart_deepcopy_collection(collection, mocker):CODE
LOW⚡tests/test_utils.py389def test_smart_deepcopy_error(error, mocker):CODE
LOW⚡tests/test_utils.py439def test_on_lower_camel_zero_length():CODE
LOW⚡tests/test_utils.py443def test_on_lower_camel_one_length():CODE
LOW⚡tests/test_utils.py447def test_on_lower_camel_many_length():CODE
LOWtests/conftest.py37def _extract_source_code_from_function(function: FunctionType):CODE
LOWtests/conftest.py160 def generate_schema_call_counter(*args: Any, **kwargs: Any) -> Any:CODE
LOW⚡tests/test_warnings.py5def test_pydantic_deprecation_warning():CODE
LOW⚡tests/test_warnings.py13def test_pydantic_deprecation_warning_tailing_dot_in_message():CODE
LOW⚡tests/test_warnings.py20def test_pydantic_deprecation_warning_calculated_expected_removal():CODE
LOWtests/test_decorators.py11def _two_pos_required_args_extra_optional(a, b, c=1, d=2, *, e=3):CODE
LOWtests/test_decorators.py19def _one_pos_required_arg_one_optional(a, b=1):CODE
LOWtests/test_decorators.py47def test_inspect_validator_error_wrap():CODE
LOWtests/test_decorators.py62def test_inspect_validator_error(mode):CODE
LOWtests/test_decorators.py76def test_inspect_field_serializer_no_signature() -> None:CODE
LOW⚡tests/test_decorators.py100def test_inspect_annotated_serializer(obj, mode, expected):CODE
LOW⚡tests/test_decorators.py105def test_inspect_annotated_serializer_invalid_number_of_arguments(mode):CODE
LOW⚡tests/test_decorators.py114def test_plain_class_not_mutated() -> None:CODE
LOWtests/test_decorators.py128def test_decorator_info_not_mutated() -> None:CODE
LOW⚡tests/test_types_typeddict.py1115def test_typeddict_extraitems_readonly() -> None:CODE
2946 more matches not shown…
Empty Error Handlers49 hits · 245 pts
SeverityFileLineSnippetContext
HIGHtests/test_exports.py124except ValueError:CODE
HIGHtests/test_exports.py143except ValueError:CODE
HIGHtests/test_generics.py2493except TestingException:CODE
HIGHtests/test_edge_cases.py3264except PydanticSchemaGenerationError:CODE
HIGHpydantic-core/tests/test_tzinfo.py176except ZoneInfoNotFoundError:CODE
HIGHpydantic-core/tests/test_schema_functions.py377except ValidationError:CODE
HIGHpydantic-core/tests/serializers/test_functions.py458except PydanticOmit:CODE
HIGHpydantic-core/tests/serializers/test_functions.py489except PydanticOmit:CODE
HIGH…antic-core/tests/benchmarks/test_complete_benchmark.py136except ValueError:CODE
HIGHpydantic-core/tests/benchmarks/test_micro_benchmarks.py196except ValidationError:CODE
HIGHpydantic-core/tests/benchmarks/test_micro_benchmarks.py221except ValidationError:CODE
HIGHpydantic-core/tests/benchmarks/test_micro_benchmarks.py869except ValidationError:CODE
HIGHpydantic-core/tests/benchmarks/test_micro_benchmarks.py886except ValidationError:CODE
HIGHpydantic-core/tests/benchmarks/test_micro_benchmarks.py1288except ValidationError:CODE
HIGHpydantic/color.py304except KeyError:CODE
HIGHpydantic/fields.py803except KeyError:CODE
HIGHpydantic/types.py2161except ValueError:CODE
HIGHpydantic/json_schema.py3236except AttributeError:CODE
HIGHpydantic/json_schema.py1355except TypeError: # pragma: no coverCODE
HIGHpydantic/networks.py1231except ValueError:CODE
HIGHpydantic/networks.py1270except ValueError:CODE
HIGHpydantic/networks.py1311except ValueError:CODE
HIGHpydantic/type_adapter.py48except KeyError:CODE
HIGHpydantic/main.py1023except PydanticUndefinedAnnotation:CODE
HIGHpydantic/v1/_hypothesis_plugin.py54except ImportError: # pragma: no coverCODE
HIGHpydantic/v1/color.py234except KeyError:CODE
HIGHpydantic/v1/types.py1101except ValueError:CODE
HIGHpydantic/v1/networks.py647except ValueError:CODE
HIGHpydantic/v1/networks.py671except ValueError:CODE
HIGHpydantic/v1/networks.py695except ValueError:CODE
HIGHpydantic/v1/utils.py690except (TypeError, ValueError, RuntimeError):CODE
HIGHpydantic/v1/dataclasses.py42except ImportError:CODE
HIGHpydantic/v1/typing.py184except TypeError: # pragma: no coverCODE
HIGHpydantic/v1/typing.py407except KeyError:CODE
HIGHpydantic/v1/typing.py425except NameError:CODE
HIGHpydantic/v1/typing.py579except exc_to_suppress:CODE
HIGHpydantic/v1/typing.py254except AttributeError:CODE
HIGHpydantic/_internal/_docs_extraction.py60except OSError: # pragma: no coverCODE
HIGHpydantic/_internal/_docs_extraction.py69except SyntaxError:CODE
HIGHpydantic/_internal/_validators.py117except ImportError:CODE
HIGHpydantic/_internal/_serializers.py45except PydanticOmit: # noqa: PERF203CODE
HIGHpydantic/_internal/_generate_schema.py1217except TypeError:CODE
HIGHpydantic/_internal/_generate_schema.py2194except AttributeError:CODE
HIGHpydantic/_internal/_generate_schema.py1163except TypeError:CODE
HIGHpydantic/_internal/_decorators.py318except AttributeError:CODE
HIGHpydantic/_internal/_fields.py528except AttributeError:CODE
HIGHpydantic/_internal/_generics.py460except TypeError: # unhashable typevar valuesCODE
HIGHpydantic/_internal/_utils.py348except (TypeError, ValueError, RuntimeError):CODE
HIGHpydantic/deprecated/copy_internals.py72except KeyError:CODE
Unused Imports251 hits · 227 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py1CODE
LOWtests/test_types_typeddict.py15CODE
LOWtests/test_plugins.py1CODE
LOWtests/test_model_validator.py1CODE
LOWtests/test_typing.py6CODE
LOWtests/test_docs.py1CODE
LOWtests/test_docs.py42CODE
LOWtests/test_docs.py47CODE
LOWtests/test_docs.py52CODE
LOWtests/test_schema_gather.py3CODE
LOWtests/test_deprecated_validate_arguments.py3CODE
LOWtests/test_construction.py2CODE
LOWtests/test_pipeline.py3CODE
LOWtests/test_titles.py14CODE
LOWtests/test_titles.py14CODE
LOWtests/types/test_namedtuple.py8CODE
LOWtests/mypy/test_mypy.py1CODE
LOWtests/mypy/test_mypy.py7CODE
LOWtests/mypy/test_mypy.py12CODE
LOWtests/mypy/test_mypy.py12CODE
LOWtests/mypy/modules/import_cycle_base.py13CODE
LOWtests/mypy/modules/create_model_var.py1CODE
LOWtests/mypy/outputs/mypy-plugin_ini/create_model_var.py1CODE
LOWtests/benchmarks/test_discriminated_unions.py1CODE
LOWtests/benchmarks/test_fastapi_startup_generics.py3CODE
LOWtests/benchmarks/test_fastapi_startup_simple.py3CODE
LOWtests/benchmarks/basemodel_eq_performance.py1CODE
LOWtests/benchmarks/basemodel_eq_performance.py559CODE
LOWtests/benchmarks/basemodel_eq_performance.py560CODE
LOWdocs/plugins/conversion_table.py1CODE
LOWdocs/plugins/algolia.py4CODE
LOWdocs/plugins/main.py1CODE
LOWpydantic-core/python/pydantic_core/__init__.py1CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py8CODE
LOWpydantic-core/python/pydantic_core/__init__.py31CODE
LOWpydantic-core/python/pydantic_core/__init__.py31CODE
LOWpydantic-core/python/pydantic_core/__init__.py31CODE
LOWpydantic-core/python/pydantic_core/core_schema.py6CODE
LOWpydantic-core/tests/conftest.py1CODE
LOWpydantic-core/tests/test_typing.py1CODE
LOWpydantic-core/tests/serializers/test_union.py1CODE
191 more matches not shown…
Docstring Block Structure41 hits · 205 pts
SeverityFileLineSnippetContext
HIGH.github/actions/people/people.py364Make a GraphQL request to GitHub API. Args: settings: Configuration settings including API token quSTRING
HIGHpydantic/color.py114Returns the name of the color if it can be found in `COLORS_BY_VALUE` dictionary, otherwise returns the hexadeciSTRING
HIGHpydantic/color.py260Parse a tuple or list to get RGBA values. Args: value: A tuple or list. Returns: An `RGBA` tupSTRING
HIGHpydantic/color.py282Parse a string representing a color to an RGBA tuple. Possible formats for the input string include: * named cSTRING
HIGHpydantic/color.py356Parse the color value provided and return a number between 0 and 1. Args: value: An integer or string colorSTRING
HIGHpydantic/color.py383Parse an alpha value checking it's a valid float in the range 0 to 1. Args: value: The input value to parseSTRING
HIGHpydantic/color.py441Converts a float value between 0 and 1 (inclusive) to an integer between 0 and 255 (inclusive). Args: c: ThSTRING
HIGHpydantic/fields.py464Create a new `FieldInfo` object with the `Field` function. Args: default: The default value for theSTRING
HIGHpydantic/fields.py820Return a new `FieldInfo` instance from a `dataclasses.Field` instance. Args: dc_field: The `dataclaSTRING
HIGHpydantic/fields.py1367!!! abstract "Usage Documentation" [Fields](../concepts/fields.md) Create a field for objects that can be cSTRING
HIGHpydantic/fields.py1693!!! abstract "Usage Documentation" [Private Model Attributes](../concepts/models.md#private-model-attributes) STRING
HIGHpydantic/fields.py1881!!! abstract "Usage Documentation" [The `computed_field` decorator](../concepts/fields.md#the-computed_field-decSTRING
HIGHpydantic/json_schema.py224!!! abstract "Usage Documentation" [Customizing the JSON Schema Generation Process](../concepts/json_schema.md#cSTRING
HIGHpydantic/json_schema.py353Generates JSON schema definitions from a list of core schemas, pairing the generated definitions with a mapping STRING
HIGHpydantic/json_schema.py400Generates a JSON schema for a specified schema in a specified mode. Args: schema: A Pydantic model.STRING
HIGHpydantic/json_schema.py485Generate a JSON schema based on the input schema. Args: schema_or_field: The core schema toSTRING
HIGHpydantic/json_schema.py1851Resolve a JsonSchemaValue to the non-ref schema if it is a $ref schema. Args: json_schema: The scheSTRING
HIGHpydantic/root_model.py76Create a new model using the provided root object and update fields set. Args: root: The root objecSTRING
HIGHpydantic/type_adapter.py230Initialize the core schema, validator, and serializer for the type. Args: ns_resolver: The namespacSTRING
HIGHpydantic/type_adapter.py375Validate a Python object against the model. A [`ValidationError`][pydantic_core.ValidationError] reports the reSTRING
HIGHpydantic/dataclasses.py80!!! abstract "Usage Documentation" [`dataclasses`](../concepts/dataclasses.md) A decorator used to create aSTRING
HIGHpydantic/main.py647Compute the class name for parametrizations of generic classes. This method can be overridden to achieve a custSTRING
HIGHpydantic/main.py758Validate a pydantic model instance. If validation fails, the resulting [`ValidationError`][pydantic_core.ValidaSTRING
HIGHpydantic/main.py811!!! abstract "Usage Documentation" [JSON Parsing](../concepts/json.md#json-parsing) Validate the giSTRING
HIGHpydantic/main.py1823!!! abstract "Usage Documentation" [Dynamic Model Creation](../concepts/models.md#dynamic-model-creation) DSTRING
HIGHpydantic/annotated_handlers.py51Get the real schema for a `{"$ref": ...}` schema. If the schema given is not a `$ref` schema, it will be returneSTRING
HIGHpydantic/annotated_handlers.py101Get the real schema for a `definition-ref` schema. If the schema given is not a `definition-ref` schema, it willSTRING
HIGHpydantic/_internal/_schema_generation_shared.py41Resolves `$ref` in the json schema. This returns the input json schema if there is no `$ref` in json schema. STRING
HIGHpydantic/_internal/_schema_generation_shared.py104Resolves reference in the core schema. Args: maybe_ref_schema: The input core schema that may contaSTRING
HIGHpydantic/_internal/_decorators_v1.py55Wrap a V1 style field validator for V2 compatibility. Args: validator: The V1 style field validator. RSTRING
HIGHpydantic/_internal/_known_annotated_metadata.py168Apply `annotation` to `schema` if it is an annotation we know about (Gt, Le, etc.). Otherwise return `None`. ThSTRING
HIGHpydantic/_internal/_model_construction.py404Inspect the namespace prior to class creation. Most of the collected information is then used by `collect_model_fieSTRING
HIGHpydantic/_internal/_model_construction.py571Finish building a model class. This logic must be called after class has been created since validation functions muSTRING
HIGHpydantic/_internal/_generate_schema.py798Generate core schema. Args: obj: The object to generate core schema for. Returns: STRING
HIGHpydantic/_internal/_discriminated_union.py38Applies the discriminator and returns a new core schema. Args: schema: The input schema. discriminaSTRING
HIGHpydantic/_internal/_discriminated_union.py145Return a new CoreSchema based on `schema` that uses a tagged-union with the discriminator provided to this classSTRING
HIGHpydantic/_internal/_decorators.py358Get the attribute from the next class in the MRO that has it, aiming to simulate calling the method on the actual clSTRING
HIGHpydantic/_internal/_decorators.py393Get an attribute out of the `__dict__` following the MRO. This prevents the call to `__get__` on the descriptor, andSTRING
HIGHpydantic/_internal/_fields.py284Collect the fields, class variables names and private attributes of a nascent Pydantic model. The fields collectionSTRING
HIGHpydantic/_internal/_generics.py165Used inside a function to check whether it was called globally. Args: depth: The depth to get the frame. STRING
HIGHpydantic/_internal/_dataclasses.py93Finish building a pydantic dataclass. This logic is called on a class which has already been wrapped in `dataclasseSTRING
Cross-Language Confusion39 hits · 192 pts
SeverityFileLineSnippetContext
HIGH⚡tests/test_serialize.py246 assert MyModel(x=None).model_dump_json() == '{"x":null}'CODE
HIGHtests/test_edge_cases.py2229 '{"v": null}',CODE
HIGHtests/test_json.py328 == '{"name":"Pumbaa","SSN":234,"birthday":737424000.0,"phone":18007267864,"friend":null}'CODE
HIGHtests/test_types.py767 Foobar.model_validate_json('{"password": 1234, "empty_password": null}')CODE
HIGHtests/test_types.py2439 assert Model().model_dump_json() == '{"f":null}'CODE
HIGHtests/types/test_dict.py46 assert ta.validate_json('{"1": 1, "2": "a", "3": null}') == {'1': 1, '2': 'a', '3': None}CODE
HIGHpydantic-core/tests/serializers/test_model.py315 assert s.to_json(BasicModel(foo=None, bar=b'more')) == b'{"foo":null,"bar":"more"}'CODE
HIGHpydantic-core/tests/serializers/test_model.py827 s.to_json(Model(3, 4), exclude_none=False, by_alias=True) == b'{"width":3,"height":4,"Area":12,"volume":null}'CODE
HIGHpydantic-core/tests/serializers/test_model.py883 s.to_json(Model(3, 4), exclude_none=False, by_alias=True) == b'{"width":3,"height":4,"volume":null,"Area":12}'CODE
HIGHpydantic-core/tests/serializers/test_model.py1090 assert s.to_json(m) == b'{"field_a":"test","field_b":12,"field_c":null,"field_d":[1,2,3]}'CODE
HIGHpydantic-core/tests/serializers/test_model.py1104 assert s.to_json(m, exclude={'field_d': [0]}) == b'{"field_a":"test","field_b":12,"field_c":null,"field_d":[2,3]}'CODE
HIGHpydantic-core/tests/serializers/test_typed_dict.py156 assert v.to_json({'foo': 1, 'bar': b'more', 'c': None}) == b'{"foo":1,"bar":"more","c":null}'CODE
HIGHpydantic-core/tests/serializers/test_typed_dict.py157 assert v.to_json({'foo': None, 'bar': b'more'}) == b'{"foo":null,"bar":"more"}'CODE
HIGHpydantic-core/tests/serializers/test_any.py661 assert s.to_json([inf]) == b'[null]'CODE
HIGHpydantic-core/tests/serializers/test_any.py664 assert s.to_json([nan]) == b'[null]'CODE
HIGHpydantic-core/tests/serializers/test_json.py23 assert s.to_json(v) == b'["a",[1,2],null]'CODE
HIGHpydantic/json_schema.py1618 with self._config_wrapper_stack.push(config):CODE
HIGHpydantic/json_schema.py1762 with self._config_wrapper_stack.push(config):CODE
HIGHpydantic/json_schema.py1974 with self._config_wrapper_stack.push(config):CODE
HIGHpydantic/type_adapter.py707 with schema_generator_instance._config_wrapper_stack.push(self._config):CODE
HIGHpydantic/_internal/_typing_extra.py263 with ns_resolver.push(base):CODE
HIGHpydantic/_internal/_typing_extra.py317 with ns_resolver.push(base):CODE
HIGHpydantic/_internal/_namespace_utils.py208 with ns_resolver.push(Model):STRING
HIGHpydantic/_internal/_namespace_utils.py215 with ns_resolver.push(Sub):STRING
HIGHpydantic/_internal/_generate_schema.py860 with self._config_wrapper_stack.push(config_wrapper), self._ns_resolver.push(cls):CODE
HIGHpydantic/_internal/_generate_schema.py1126 with self.model_type_stack.push(obj):CODE
HIGHpydantic/_internal/_generate_schema.py1310 with self.field_name_stack.push(name):CODE
HIGHpydantic/_internal/_generate_schema.py1399 with self._ns_resolver.push(origin):CODE
HIGHpydantic/_internal/_generate_schema.py1437 self.model_type_stack.push(typed_dict_cls),CODE
HIGHpydantic/_internal/_generate_schema.py1460 with self._config_wrapper_stack.push(config):CODE
HIGHpydantic/_internal/_generate_schema.py1569 self.model_type_stack.push(namedtuple_cls),CODE
HIGHpydantic/_internal/_generate_schema.py1625 with self.field_name_stack.push(name):CODE
HIGHpydantic/_internal/_generate_schema.py1667 with self.field_name_stack.push(name):CODE
HIGHpydantic/_internal/_generate_schema.py1717 with self.field_name_stack.push(name):CODE
HIGHpydantic/_internal/_generate_schema.py1906 self.model_type_stack.push(dataclass),CODE
HIGHpydantic/_internal/_generate_schema.py1933 with self._ns_resolver.push(dataclass), self._config_wrapper_stack.push(config):CODE
HIGHpydantic/_internal/_fields.py606 with ns_resolver.push(cls):CODE
HIGHpydantic/_internal/_fields.py714 with ns_resolver.push(base):CODE
HIGHpydantic/_internal/_fields.py811 with ns_resolver.push(cls):CODE
Fake / Example Data102 hits · 128 pts
SeverityFileLineSnippetContext
LOWREADME.md50 name: str = 'John Doe'CODE
LOWREADME.md57#> User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]COMMENT
LOWtests/test_types_typeddict.py978 m = Model.model_validate({'a': {'name': 'John Doe', 'extra': 'something'}})CODE
LOWtests/test_types_typeddict.py980 assert m.model_dump() == {'a': {'name': 'John Doe', 'extra': 'something'}}CODE
LOWtests/test_rich_repr.py13 name: str = 'John Doe'CODE
LOWtests/test_rich_repr.py26 ('name', 'John Doe'),CODE
LOW⚡tests/test_dataclasses.py561 name: str = 'John Doe'CODE
LOW⚡tests/test_dataclasses.py570 assert fields['name'].default == 'John Doe'CODE
LOWtests/test_dataclasses.py614 name: str = 'John Doe'CODE
LOWtests/test_dataclasses.py642 'name': {'default': 'John Doe', 'title': 'Name', 'type': 'string'},CODE
LOW⚡tests/test_config.py124 ('id: int = 1', 'bar=2', 'baz: Any', "name: str = 'John Doe'", 'foo: str', '**data'),CODE
LOW⚡tests/test_config.py126 assert _equals(str(sig), "(id: int = 1, bar=2, *, baz: Any, name: str = 'John Doe', foo: str, **data) -> None")CODE
LOWtests/test_config.py111 name: str = 'John Doe'CODE
LOWtests/test_networks.py236 url = validate_url('http://user:@example.org')CODE
LOWtests/test_networks.py243 url = validate_url('http://:password@example.org')CODE
LOW⚡tests/test_edge_cases.py2329 assert module.User(id=12).model_dump() == {'id': 12, 'name': 'Jane Doe'}CODE
LOWtests/test_edge_cases.py2802 data = {'age': 'John Doe'}CODE
LOW⚡tests/test_edge_cases.py2322 name: str = 'Jane Doe'STRING
LOWtests/test_json_schema.py6730 b: Annotated[int, 'placeholder'] = ...CODE
LOW⚡tests/test_model_signature.py66 ('id: int = 1', 'bar=2', 'baz: Any', "name: str = 'John Doe'", 'foo: str', '**data'),CODE
LOW⚡tests/test_model_signature.py69 assert _equals(str(sig), "(id: int = 1, bar=2, *, baz: Any, name: str = 'John Doe', foo: str, **data) -> None")CODE
LOWtests/test_model_signature.py53 name: str = 'John Doe'CODE
LOWtests/test_types.py2275 assert Foo(baz=' uSeR@ExAmPlE.com ').baz == 'user@example.com'CODE
LOWdocs/index.md63 name: str = 'John Doe' # (2)!CODE
LOWdocs/index.md86 'name': 'John Doe',STRING
LOWdocs/index.md120 name: str = 'John Doe'CODE
LOWdocs/plugins/devtools_output.html22user: id=123 name='John Doe' signup_ts=datetime.datetime(2019, 6, 1, 12, 22) friends=[1234, 4567, 7890] address=Address(CODE
LOWdocs/integrations/devtools.md38 name='John Doe',CODE
LOW⚡docs/examples/queues.md38user1 = User(id=1, name='John Doe', email='john@example.com')CODE
LOW⚡docs/examples/queues.md39user2 = User(id=2, name='Jane Doe', email='jane@example.com')CODE
LOW⚡docs/examples/queues.md42#> Added to queue: {"id":1,"name":"John Doe","email":"john@example.com"}COMMENT
LOW⚡docs/examples/queues.md45#> Added to queue: {"id":2,"name":"Jane Doe","email":"jane@example.com"}COMMENT
LOWdocs/examples/queues.md59#> Validated user: User(id=1, name='John Doe', email='john@example.com')COMMENT
LOWdocs/examples/queues.md62#> Validated user: User(id=2, name='Jane Doe', email='jane@example.com')COMMENT
LOW⚡docs/examples/queues.md109user1 = User(id=1, name='John Doe', email='john@example.com')CODE
LOW⚡docs/examples/queues.md110user2 = User(id=2, name='Jane Doe', email='jane@example.com')CODE
LOW⚡docs/examples/queues.md113#> Added to queue: {"id":1,"name":"John Doe","email":"john@example.com"}COMMENT
LOW⚡docs/examples/queues.md116#> Added to queue: {"id":2,"name":"Jane Doe","email":"jane@example.com"}COMMENT
LOWdocs/examples/queues.md218 user1 = User(id=1, name='John Doe', email='john@example.com')CODE
LOWdocs/examples/queues.md219 user2 = User(id=2, name='Jane Doe', email='jane@example.com')CODE
LOWdocs/examples/files.md16 "name": "John Doe",CODE
LOWdocs/examples/files.md39#> name='John Doe' age=30 email='john@example.com'COMMENT
LOWdocs/examples/files.md97 "name": "John Doe",CODE
LOWdocs/examples/files.md102 "name": "Jane Doe",CODE
LOWdocs/examples/files.md128#> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com')COMMENT
LOWdocs/examples/files.md128#> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com')COMMENT
LOWdocs/examples/files.md147{"name": "John Doe", "age": 30, "email": "john@example.com"}CODE
LOWdocs/examples/files.md148{"name": "Jane Doe", "age": 25, "email": "jane@example.com"}CODE
LOWdocs/examples/files.md168#> [Person(name='John Doe', age=30, email='john@example.com'), Person(name='Jane Doe', age=25, email='jane@example.com')COMMENT
LOWdocs/examples/files.md168#> [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.md204#> [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.md204#> [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.md214name = "John Doe"CODE
LOWdocs/examples/files.md238#> name='John Doe' age=30 email='john@example.com'COMMENT
LOWdocs/examples/files.md272#> name='John Doe' age=30 email='john@example.com'COMMENT
LOWdocs/examples/files.md308#> name='John Doe' age=30 email='john@example.com'COMMENT
LOWdocs/examples/files.md342#> name='John Doe' age=30 email='john@example.com'COMMENT
LOWdocs/concepts/json_schema.md926 'name': 'John Doe',CODE
LOWdocs/concepts/json_schema.md940 "name": "John Doe"STRING
LOW⚡docs/concepts/unions.md152user_01 = User(id=123, name='John Doe')CODE
42 more matches not shown…
Deep Nesting126 hits · 106 pts
SeverityFileLineSnippetContext
LOWtests/test_exports.py33CODE
LOWtests/test_exports.py39CODE
LOWtests/test_docs.py86CODE
LOWdocs/plugins/main.py54CODE
LOWpydantic-core/wasm-preview/run_tests.py18CODE
LOWpydantic-core/tests/conftest.py69CODE
LOWpydantic-core/tests/conftest.py131CODE
LOWpydantic-core/tests/test_errors.py713CODE
LOWpydantic-core/tests/validators/test_string.py351CODE
LOWpydantic-core/tests/validators/test_url.py71CODE
LOWpydantic-core/tests/validators/test_url.py485CODE
LOWpydantic-core/tests/validators/test_url.py1005CODE
LOWpydantic-core/tests/validators/test_url.py1061CODE
LOW.github/actions/people/people.py451CODE
LOW.github/actions/people/people.py497CODE
LOW.github/actions/people/people.py581CODE
LOWpydantic/fields.py652CODE
LOWpydantic/fields.py753CODE
LOWpydantic/fields.py1012CODE
LOWpydantic/mypy.py191CODE
LOWpydantic/mypy.py374CODE
LOWpydantic/mypy.py595CODE
LOWpydantic/mypy.py931CODE
LOWpydantic/mypy.py1034CODE
LOWpydantic/mypy.py1059CODE
LOWpydantic/mypy.py1117CODE
LOWpydantic/types.py3117CODE
LOWpydantic/types.py1030CODE
LOWpydantic/json_schema.py3136CODE
LOWpydantic/json_schema.py200CODE
LOWpydantic/json_schema.py902CODE
LOWpydantic/json_schema.py961CODE
LOWpydantic/json_schema.py1462CODE
LOWpydantic/json_schema.py1505CODE
LOWpydantic/json_schema.py1599CODE
LOWpydantic/json_schema.py1683CODE
LOWpydantic/json_schema.py2623CODE
LOWpydantic/json_schema.py2627CODE
LOWpydantic/main.py334CODE
LOWpydantic/main.py410CODE
LOWpydantic/main.py1460CODE
LOWpydantic/main.py1115CODE
LOWpydantic/v1/_hypothesis_plugin.py356CODE
LOWpydantic/v1/fields.py197CODE
LOWpydantic/v1/fields.py581CODE
LOWpydantic/v1/fields.py850CODE
LOWpydantic/v1/fields.py898CODE
LOWpydantic/v1/fields.py1000CODE
LOWpydantic/v1/fields.py1053CODE
LOWpydantic/v1/fields.py1171CODE
LOWpydantic/v1/decorator.py61CODE
LOWpydantic/v1/decorator.py179CODE
LOWpydantic/v1/validators.py81CODE
LOWpydantic/v1/validators.py316CODE
LOWpydantic/v1/validators.py699CODE
LOWpydantic/v1/env_settings.py166CODE
LOWpydantic/v1/env_settings.py281CODE
LOWpydantic/v1/env_settings.py94CODE
LOWpydantic/v1/mypy.py171CODE
LOWpydantic/v1/mypy.py344CODE
66 more matches not shown…
Cross-File Repetition12 hits · 60 pts
SeverityFileLineSnippetContext
HIGHtests/test_aliases.py0this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take pSTRING
HIGHpydantic-core/tests/validators/test_typed_dict.py0this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take pSTRING
HIGHpydantic-core/tests/validators/test_dataclasses.py0this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take pSTRING
HIGHpydantic-core/tests/validators/test_model_fields.py0this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take pSTRING
HIGHpydantic-core/tests/validators/test_arguments.py0this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take pSTRING
HIGH…antic-core/tests/validators/arguments_v3/test_alias.py0this test reflects the priority that applies for config vs runtime validation alias configuration. runtime values take pSTRING
HIGHtests/mypy/modules/decorator_implicit_classmethod.py0test that the mypy plugin implicitly transforms the right decorators into class methods.STRING
HIGH…yproject-plugin_toml/decorator_implicit_classmethod.py0test that the mypy plugin implicitly transforms the right decorators into class methods.STRING
HIGH…puts/mypy-plugin_ini/decorator_implicit_classmethod.py0test that the mypy plugin implicitly transforms the right decorators into class methods.STRING
HIGHpydantic-core/tests/serializers/test_model.py0this test reflects the priority that applies for config vs runtime serialization alias configuration. if the runtime valSTRING
HIGHpydantic-core/tests/serializers/test_typed_dict.py0this test reflects the priority that applies for config vs runtime serialization alias configuration. if the runtime valSTRING
HIGHpydantic-core/tests/serializers/test_dataclasses.py0this test reflects the priority that applies for config vs runtime serialization alias configuration. if the runtime valSTRING
AI Structural Patterns67 hits · 50 pts
SeverityFileLineSnippetContext
LOWtests/typechecking/decorators.py209CODE
LOWtests/typechecking/decorators.py214CODE
LOWtests/typechecking/decorators.py219CODE
LOWpydantic-core/python/pydantic_core/core_schema.py656CODE
LOWpydantic-core/python/pydantic_core/core_schema.py718CODE
LOWpydantic-core/python/pydantic_core/core_schema.py785CODE
LOWpydantic-core/python/pydantic_core/core_schema.py856CODE
LOWpydantic-core/python/pydantic_core/core_schema.py964CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1094CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1160CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1230CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1304CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1718CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1775CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1932CODE
LOWpydantic-core/python/pydantic_core/core_schema.py1995CODE
LOWpydantic-core/python/pydantic_core/core_schema.py2054CODE
LOWpydantic-core/python/pydantic_core/core_schema.py2187CODE
LOWpydantic-core/python/pydantic_core/core_schema.py2250CODE
LOWpydantic-core/python/pydantic_core/core_schema.py2318CODE
LOWpydantic-core/python/pydantic_core/core_schema.py2385CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3050CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3161CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3226CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3540CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3670CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3745CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3845CODE
LOWpydantic-core/python/pydantic_core/core_schema.py3983CODE
LOWpydantic-core/python/pydantic_core/core_schema.py4201CODE
LOWpydantic-core/python/pydantic_core/core_schema.py4561CODE
LOWpydantic-core/python/pydantic_core/core_schema.py4630CODE
LOWpydantic-core/tests/validators/test_model.py230CODE
LOWpydantic/fields.py1083CODE
LOWpydantic/fields.py1123CODE
LOWpydantic/fields.py1163CODE
LOWpydantic/fields.py1206CODE
LOWpydantic/fields.py1246CODE
LOWpydantic/fields.py1289CODE
LOWpydantic/fields.py1327CODE
LOWpydantic/fields.py1849CODE
LOWpydantic/fields.py1865CODE
LOWpydantic/fields.py220CODE
LOWpydantic/mypy.py1264CODE
LOWpydantic/types.py759CODE
LOWpydantic/types.py1053CODE
LOWpydantic/networks.py516CODE
LOWpydantic/root_model.py128CODE
LOWpydantic/type_adapter.py535CODE
LOWpydantic/type_adapter.py599CODE
LOWpydantic/dataclasses.py33CODE
LOWpydantic/dataclasses.py51CODE
LOWpydantic/dataclasses.py66CODE
LOWpydantic/main.py1776CODE
LOWpydantic/main.py1809CODE
LOWpydantic/main.py472CODE
LOWpydantic/main.py538CODE
LOWpydantic/main.py1411CODE
LOWpydantic/v1/fields.py221CODE
LOWpydantic/v1/types.py449CODE
7 more matches not shown…
Modern Structural Boilerplate33 hits · 34 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_dataclasses.py3286 def update_schema(schema: dict[str, Any]) -> None:CODE
LOWrelease/prepare.py23def update_version(new_version: str, dry_run: bool) -> None:CODE
LOWrelease/prepare.py100def update_history(new_version: str, dry_run: bool, force_update: bool) -> None:CODE
LOWpydantic-core/python/pydantic_core/__init__.py43__all__ = [CODE
LOWpydantic/fields.py1787 def _update_from_config(self, config_wrapper: ConfigWrapper, name: str) -> None:CODE
LOWpydantic/mypy.py1034 def set_frozen(self, fields: list[PydanticModelField], api: SemanticAnalyzerPluginInterface, frozen: bool) -> None:CODE
LOWpydantic/json_schema.py1769 def _update_class_schema(self, json_schema: JsonSchemaValue, cls: type[Any], config: ConfigDict) -> None:CODE
LOWpydantic/networks.py73__all__ = [CODE
LOWpydantic/main.py1696 def update_forward_refs(cls, **localns: Any) -> None: # noqa: D102CODE
LOWpydantic/v1/fields.py197 def update_from_config(self, from_config: Dict[str, Any]) -> None:CODE
LOWpydantic/v1/fields.py516 def set_config(self, config: Type['BaseConfig']) -> None:CODE
LOWpydantic/v1/fields.py557 def _set_default_and_type(self) -> None:CODE
LOWpydantic/v1/__init__.py22__all__ = [CODE
LOWpydantic/v1/mypy.py539 def set_frozen(self, fields: List['PydanticModelField'], frozen: bool) -> None:CODE
LOWpydantic/v1/types.py58__all__ = [CODE
LOWpydantic/v1/networks.py72__all__ = [CODE
LOWpydantic/v1/utils.py225def update_not_none(mapping: Dict[Any, Any], **update: Any) -> None:CODE
LOWpydantic/v1/dataclasses.py92__all__ = [CODE
LOWpydantic/v1/typing.py537def update_field_forward_refs(field: 'ModelField', globalns: Any, localns: Any) -> None:CODE
LOWpydantic/v1/main.py833 def update_forward_refs(cls, **localns: Any) -> None:CODE
LOWpydantic/_internal/_model_construction.py499def set_default_hash_func(cls: type[BaseModel], bases: tuple[type[Any], ...]) -> None:CODE
LOWpydantic/_internal/_model_construction.py685def set_deprecated_descriptors(cls: type[BaseModel]) -> None:CODE
LOWpydantic/_internal/_schema_gather.py8__all__ = [CODE
LOWpydantic/_internal/_discriminated_union.py28def set_discriminator_in_metadata(schema: CoreSchema, discriminator: Any) -> None:CODE
LOWpydantic/_internal/_discriminated_union.py494 def _set_unique_choice_for_values(self, choice: core_schema.CoreSchema, values: list[Any]) -> None:CODE
LOWpydantic/_internal/_decorators.py522 def update_from_config(self, config_wrapper: ConfigWrapper) -> None:CODE
LOW⚡pydantic/_internal/_fields.py152def _update_fields_from_docstrings(cls: type[Any], fields: dict[str, FieldInfo], use_inspect: bool = False) -> None:CODE
LOWpydantic/_internal/_fields.py222def update_field_from_config(config_wrapper: ConfigWrapper, field_name: str, field_info: FieldInfo) -> None:CODE
LOWpydantic/_internal/_mock_val_ser.py117def set_type_adapter_mocks(adapter: TypeAdapter) -> None:CODE
LOWpydantic/_internal/_mock_val_ser.py156def set_model_mocks(cls: type[BaseModel], undefined_name: str | None = None) -> None:CODE
LOWpydantic/_internal/_mock_val_ser.py197def set_dataclass_mocks(cls: type[PydanticDataclass], undefined_name: str | None = None) -> None:CODE
LOWpydantic/_internal/_utils.py142def update_not_none(mapping: dict[Any, Any], **update: Any) -> None:CODE
LOWpydantic/experimental/pipeline.py27__all__ = ['validate_as', 'validate_as_deferred', 'transform']CODE
Self-Referential Comments13 hits · 23 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_validators.py3135 ) # Create a Sub instance without triggering validation (e.g., using model_construct)CODE
MEDIUMtests/test_main.py3160 # Defining a nested type does not errorCOMMENT
MEDIUM⚡tests/test_types.py2104 # Create a module that exists, but fails to import due to missing dependencyCOMMENT
MEDIUMpydantic/types.py997 # Create an instanceSTRING
MEDIUMpydantic/json_schema.py102 """This class is used to emit warnings produced during JSON schema generation.STRING
MEDIUMpydantic/json_schema.py2669 """This method is responsible for ignoring warnings as desired, and for formatting the warning messages.STRING
MEDIUMpydantic/functional_serializers.py150 """This method is used to get the Pydantic core schema of the class.STRING
MEDIUMpydantic/_internal/_model_construction.py362 """This function is meant to behave like a BaseModel method to initialize private attributes.STRING
MEDIUMpydantic/_internal/_generate_schema.py2234 # Create a new ComputedFieldInfo so that different type parametrizations of the sameCOMMENT
MEDIUMpydantic/_internal/_discriminated_union.py73 """This class is used to convert an input schema containing a union schema into one where that union isSTRING
MEDIUMpydantic/_internal/_decorators.py804 # Define the types we want to check against as a single tuple.COMMENT
MEDIUMpydantic/plugin/__init__.py51 """This method is called for each plugin every time a new [`SchemaValidator`][pydantic_core.SchemaValidator]STRING
MEDIUMpydantic/deprecated/config.py31 """This class is only retained for backwards compatibility.STRING
Over-Commented Block21 hits · 20 pts
SeverityFileLineSnippetContext
LOWtests/test_edge_cases.py1161 assert exc_info.value.errors(include_url=False) == [COMMENT
LOWtests/test_edge_cases.py1181COMMENT
LOW…sts/mypy/outputs/pyproject-default_toml/root_models.py61# MYPY: error: Argument "m1" to "Model" has incompatible type "int"; expected "Maybe[int]" [arg-type]COMMENT
LOWtests/mypy/outputs/mypy-default_ini/root_models.py61# MYPY: error: Argument "m1" to "Model" has incompatible type "int"; expected "Maybe[int]" [arg-type]COMMENT
LOWpydantic-core/tests/test.rs1#[cfg(test)]COMMENT
LOWpydantic-core/src/schema_gather.rs241/// Context instances should only be used during schema traversing.COMMENT
LOWpydantic-core/src/schema_gather.rs261 /// Core schemas are stored (and thus shared) on successfully completed Pydantic models (and otherCOMMENT
LOWpydantic-core/src/definitions.rs21COMMENT
LOWpydantic-core/src/validators/decimal.rs141 break;COMMENT
LOWpydantic-core/src/validators/validation_state.rs21pub struct ValidationState<'a, 'py> {COMMENT
LOWpydantic-core/src/errors/location.rs81}COMMENT
LOW.github/workflows/docs-navigation.yml1name: Docs Navigation CheckCOMMENT
LOW.github/workflows/third-party.yml1# This workflow runs on pull requests labeled with `third-party-tests`, inspired by:COMMENT
LOWpydantic/main.py1261 # Resort to costly filtering of the __dict__ objectsCOMMENT
LOWpydantic/v1/_hypothesis_plugin.py41# them on-disk, and that's unsafe in general without being told *where* to do so.COMMENT
LOWpydantic/v1/generics.py221 if not issubclass(base_model, GenericModel):COMMENT
LOWpydantic/_internal/_namespace_utils.py241 if not self._types_stack:COMMENT
LOWpydantic/_internal/_discriminated_union.py81 I have chosen to implement the conversion algorithm in this class, rather than a function,COMMENT
LOWpydantic/_internal/_discriminated_union.py101 # debugging challenges for users making subtle mistakes.COMMENT
LOWpydantic/_internal/_discriminated_union.py121 # the final value in another nullable schema.COMMENT
LOWpydantic/_internal/_generics.py121 """COMMENT
AI Slop Vocabulary12 hits · 19 pts
SeverityFileLineSnippetContext
LOWtests/test_dataclasses.py2271 # for standard dataclasses, so we just use TypeAdapter to get validation for each.COMMENT
MEDIUMtests/test_edge_cases.py2242 """This is primarily included in order to document the behavior / limitations of the `Hashable` type's validation loSTRING
LOWpydantic-core/tests/serializers/test_any.py349 # because when recursion is detected and we're in mode python, we just return the valueCOMMENT
LOWpydantic-core/tests/serializers/test_any.py384 # when recursion is detected and we're in mode python, we just return the valueCOMMENT
LOWpydantic/functional_validators.py277 # we don't want to bother with further validation, just return the new valueSTRING
LOWpydantic/types.py1758 # hence we just use `secret_display`COMMENT
MEDIUMpydantic/json_schema.py3149 # for instance when "examples" is used as a property key. A more robust solutionCOMMENT
LOWpydantic/json_schema.py461 # If a schema with the same CoreRef has been handled, just return a reference to itCOMMENT
LOWpydantic/main.py1255 # early if there are no keys to ignore (we would just return False later on anyway)COMMENT
LOWpydantic/v1/error_wrappers.py46# but recursive, therefore just use:COMMENT
MEDIUMpydantic/_internal/_docs_extraction.py97 # making it way more robust.COMMENT
LOWpydantic/_internal/_validators.py74 # otherwise we just return the value and let the next validator do the rest of the workCOMMENT
Overly Generic Function Names14 hits · 13 pts
SeverityFileLineSnippetContext
LOWtests/test_config.py460 def my_function():STRING
LOWtests/test_config.py486 def my_function():STRING
LOW⚡tests/test_types.py1597 def my_function(y: type_hint):CODE
LOWtests/types/unions/test_union.py326 def do_something(self):CODE
LOWtests/types/unions/test_union.py335 def do_something(self):CODE
LOWpydantic-core/tests/test_errors.py87 def my_function(input_value, info):CODE
LOWpydantic-core/tests/validators/test_function.py65 def my_function(input_value, info):CODE
LOWpydantic-core/tests/validators/test_function.py100 def my_function(input_value, info):CODE
LOWpydantic-core/tests/validators/test_call.py26 def my_function(a, b, c):CODE
LOWpydantic-core/tests/validators/test_call.py69 def my_function(a, b, c):CODE
LOWpydantic-core/tests/validators/test_call.py83 def my_function(a):CODE
LOWpydantic-core/tests/validators/test_call.py93 def my_function(a):CODE
LOWpydantic-core/tests/validators/test_call.py177 def my_function(a, b, c):CODE
LOWpydantic-core/tests/validators/test_call.py197 def my_function(a):CODE
Cross-Language Confusion (JS/TS)2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHpydantic-core/wasm-preview/worker.js28 print(tty);CODE
HIGHpydantic-core/wasm-preview/worker.js32 print(tty);CODE
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALpydantic/v1/mypy.py334 for name, sym in self._ctx.cls.info.names.items():CODE
Excessive Try-Catch Wrapping8 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/mypy/test_mypy.py229 except Exception:CODE
LOWpydantic-core/wasm-preview/run_tests.py63except Exception:CODE
LOWpydantic/json_schema.py1337 except Exception:CODE
LOWpydantic/json_schema.py2561 except Exception as e:CODE
LOWpydantic/v1/_hypothesis_plugin.py226 except Exception: # pragma: no coverCODE
LOWpydantic/_internal/_type_refs.py99 except Exception:CODE
LOWpydantic/_internal/_typing_extra.py277 except Exception:CODE
LOWpydantic/plugin/_schema_validator.py128 except Exception as exception:CODE
AI Response Leakage1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHpydantic/v1/mypy.py557 # I don't know whether it's possible to hit this branch, but I've added it for safetyCOMMENT
Dead Code1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_deprecated.py574CODE