pydantic/pydantic
164 findings in 63 Python files · 42,749 lines · scanned in 22.7 s on 2026-11-12
Every number here comes from the same analyzer that runs on your upload, on the tree as it is in the repository. A finding is listed with the function or module it sits in; nothing is matched from text. Tests, examples and benchmarks are excluded from the scan, so "never referenced inside the project" means exactly that.
import_cycle 2
modules that import each other
pydantic-core.python.pydantic_coreCircular import between 2 modules: pydantic-core.python.pydantic_core -> pydantic-core.python.pydantic_core.core_schemapydantic._internal._configCircular import between 26 modules: pydantic._internal._config -> pydantic._internal._contextlib -> pydantic._internal._dataclasses -> pydantic._internal._decorators -> pydantic._internal._discriminated_union -> pydantic._internal._fields -> pydantic._internal._forward_ref -> pydantic._internal._generate_schema -> pydantic._internal._generics -> pydantic._internal._known_annotated_metadata -> pydantic._internal._mock_val_ser -> pydantic._internal._namespace_utils -> pydantic._internal._repr -> pydantic._internal._signature -> pydantic._internal._type_refs -> pydantic._internal._typing_extra -> pydantic._internal._utils -> pydantic._internal._validators -> pydantic.aliases -> pydantic.config -> pydantic.dataclasses -> pydantic.errors -> pydantic.fields -> pydantic.functional_validators -> pydantic.json_schema -> pydantic.types
god_class 5
a class that owns too much
pydantic._internal._generate_schema.GenerateSchema69 methods — likely does too muchpydantic.experimental.pipeline._Pipeline32 methods — likely does too muchpydantic.json_schema.GenerateJsonSchema109 methods — likely does too muchpydantic.main.BaseModel34 methods — likely does too muchpydantic.networks._BaseUrl27 methods — likely does too much
wide_signature 9
functions that take so many arguments the call sites are unreadable
pydantic._internal._model_construction.ModelMetaclass.__new__8 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 8 call sites (pydantic/fields.py:944, pydantic/main.py:321, pydantic/main.py:1005)pydantic.mypy.PydanticModelField.__init__10 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 12 call sites (pydantic/_internal/_discriminated_union.py:25, pydantic/_internal/_docs_extraction.py:14, pydantic/_internal/_generics.py:44)pydantic.mypy.PydanticModelField.to_argument8 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 1 call site (pydantic/mypy.py:1154)pydantic.mypy.PydanticModelTransformer.get_field_arguments8 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 2 call sites (pydantic/mypy.py:903, pydantic/mypy.py:962)pydantic.mypy.ModelConfigData.__init__7 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 12 call sites (pydantic/_internal/_discriminated_union.py:25, pydantic/_internal/_docs_extraction.py:14, pydantic/_internal/_generics.py:44)pydantic.mypy.add_method7 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 2 call sites (pydantic/mypy.py:944, pydantic/mypy.py:977)
and 3 more of the same check.
complex 33
branchy functions, counted from the AST
pydantic._internal._fields.collect_model_fieldscyclomatic complexity 57pydantic.experimental.pipeline._apply_constraintcyclomatic complexity 45pydantic.fields.FieldInfo.__init__cyclomatic complexity 48pydantic._internal._discriminated_union._ApplyInferredDiscriminator._handle_choicecyclomatic complexity 17pydantic._internal._discriminated_union._ApplyInferredDiscriminator._infer_discriminator_values_for_choicecyclomatic complexity 21pydantic._internal._fields.collect_dataclass_fieldscyclomatic complexity 19
and 27 more of the same check.
duplicate 11
the same block in two places
pydantic._internal._generate_schema._FieldNameStack.pushIdentical code in 2 functions (pydantic._internal._generate_schema._FieldNameStack.push, pydantic._internal._generate_schema._ModelTypeStack.push) — extract it into one function and call it from eachpydantic.fields.ComputedFieldInfo.deprecation_messageIdentical code in 2 functions (pydantic.fields.ComputedFieldInfo.deprecation_message, pydantic.fields.FieldInfo.deprecation_message) — extract it into one function and call it from eachpydantic.functional_validators.ModelWrapValidator.__call__Identical code in 2 functions (pydantic.functional_validators.ModelWrapValidator.__call__, pydantic.functional_validators._V2WrapValidatorClsMethod.__call__) — extract it into one function and call it from eachpydantic.functional_validators.ModelBeforeValidator.__call__Identical code in 2 functions (pydantic.functional_validators.ModelBeforeValidator.__call__, pydantic.functional_validators.ModelWrapValidatorWithoutInfo.__call__) — extract it into one function and call it from eachpydantic.functional_validators.FreeModelBeforeValidator.__call__Identical code in 2 functions (pydantic.functional_validators.FreeModelBeforeValidator.__call__, pydantic.functional_validators.ModelBeforeValidatorWithoutInfo.__call__) — extract it into one function and call it from eachpydantic.networks._BaseMultiHostUrl.encoded_stringIdentical code in 2 functions (pydantic.networks._BaseMultiHostUrl.encoded_string, pydantic.networks._BaseUrl.encoded_string) — extract it into one function and call it from each
and 5 more of the same check.
hub 6
a module everything depends on
pydantic-core.python.pydantic_core.core_schema.plain_serializer_function_ser_schemacalled from 16 places — change here ripples widelypydantic-core.python.pydantic_core.core_schema.no_info_after_validator_functioncalled from 15 places — change here ripples widelypydantic-core.python.pydantic_core.core_schema._dict_not_nonecalled from 74 places — change here ripples widelypydantic._internal._generate_schema.GenerateSchema.generate_schemacalled from 31 places — change here ripples widelypydantic.experimental.pipeline._Pipeline.constraincalled from 15 places — change here ripples widelypydantic.json_schema.GenerateJsonSchema.generate_innercalled from 39 places — change here ripples widely
coupling 6
modules that know too much about each other
pydantic._internal._dataclassesdepends on 17 project modulespydantic._internal._fieldsdepends on 17 project modulespydantic._internal._generate_schemadepends on 37 project modulespydantic._internal._model_constructiondepends on 19 project modulespydantic.json_schemadepends on 18 project modulespydantic.maindepends on 23 project modules
wildcard_import 1
a star import that puts unknown names in scope
pydantic`from pydantic.errors import *` at line 25 — no tool can resolve which names this module uses; import the names you need
large_module 7
a check from the analyzer
pydantic-core.python.pydantic_core.core_schema4711 linespydantic-core.src.self_schema6853 linespydantic._internal._generate_schema2891 linespydantic.fields1949 linespydantic.json_schema3277 linespydantic.main1503 lines
and 1 more of the same check.
unused 52
never called, never imported, never read
.github.actions.people.people.get_issues_expertsnever referenced inside the project (dead code or public API)pydantic-core.python.pydantic_core.core_schema.format_ser_schemanever referenced inside the project (dead code or public API)pydantic-core.python.pydantic_core.core_schema.model_ser_schemanever referenced inside the project (dead code or public API)pydantic-core.python.pydantic_core.core_schema.invalid_schemanever referenced inside the project (dead code or public API)pydantic-core.python.pydantic_core.core_schema.filter_seq_schemanever referenced inside the project (dead code or public API)pydantic-core.python.pydantic_core.core_schema.filter_dict_schemanever referenced inside the project (dead code or public API)
and 46 more of the same check.
bad_name 32
a name that does not say what the thing holds
pydantic-core.python.pydantic_core.core_schema.int_schemanames say nothing (ge, gt, le, lt) — rename to what they holdpydantic-core.python.pydantic_core.core_schema.float_schemanames say nothing (ge, gt, le, lt) — rename to what they holdpydantic-core.python.pydantic_core.core_schema.decimal_schemanames say nothing (ge, gt, le, lt) — rename to what they holdpydantic-core.python.pydantic_core.core_schema.fraction_schemanames say nothing (ge, gt, le, lt) — rename to what they holdpydantic-core.python.pydantic_core.core_schema.date_schemanames say nothing (ge, gt, le, lt) — rename to what they holdpydantic-core.python.pydantic_core.core_schema.time_schemanames say nothing (ge, gt, le, lt) — rename to what they hold
and 26 more of the same check.
Five projects free. A .zip or a public GitHub URL.
Other repositories, same treatment
- Textualize/rich 97 findings
- celery/celery 1052 findings
- encode/django-rest-framework 337 findings
- encode/httpx 26 findings
- fastapi/fastapi 163 findings
- pallets/click 85 findings
- pallets/flask 45 findings
- psf/requests 47 findings
- scrapy/scrapy 186 findings