Opened 9 years ago

Closed 9 years ago

#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 (5)

comment:1 by Tim Graham, 9 years ago

Has patch: set
Summary: Refactor MigrationWriterRefactor MigrationWriter.serialize()
Triage Stage: UnreviewedAccepted

comment:2 by Markus Holtermann, 9 years ago

Looks good on the first glimpse :) . I'll need a bit more time to actually look into it.

comment:3 by Yoong Kang Lim, 9 years ago

Owner: changed from nobody to Yoong Kang Lim
Status: newassigned

comment:4 by Markus Holtermann, 9 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

comment:5 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 4b1529e2:

Fixed #26151 -- Refactored MigrationWriter.serialize()

Thanks Markus Holtermann for review.

Note: See TracTickets for help on using tickets.
Back to Top