#26151 closed Cleanup/optimization (fixed)
Refactor MigrationWriter.serialize()
| Reported by: | Yoong Kang Lim | Owned by: | Yoong Kang Lim |
|---|---|---|---|
| Component: | Migrations | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The serializer() method in MigrationWriter has a McCabe Cyclomatic Complexity of 50, one of the highest in the entire Django code base.
The serialization logic should be in different Serializer classes. MigrationWriter.serialize() should call a Serializer Factory to obtain the correct Serializer for the value passed in.
Change History (6)
comment:1 by , 10 years ago
| Has patch: | set |
|---|---|
| Summary: | Refactor MigrationWriter → Refactor MigrationWriter.serialize() |
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 10 years ago
Looks good on the first glimpse :) . I'll need a bit more time to actually look into it.
comment:3 by , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:4 by , 10 years ago
Since a discussion on #django-dev came up earlier I posted to the developer mailing list to get other people's input: https://groups.google.com/forum/#!topic/django-developers/yGKl7ZkLac4
PR