We should cleanup the module code.

Many callbacks can be moved into a separated file and would reduce complexity of the base file.

Also we should limit the code execution complexity for regular calls. Especially if advpoll isn't even involved.

Comments

miro_dietiker’s picture

Status: Active » Needs work

Committed a first cleanup.

Moved things out of advpoll.module.
Created .pages.inc and .admin.inc files.

Seems to be well checked, everything still works as expected.
Needs more cleanup!

jacob.embree’s picture

Version: 6.x-1.x-dev » 7.x-3.x-dev
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new167.93 KB

First attempt here. Plenty more to do. Part of the coder review involved fixing #2407473: Choice form element key is not concatenated correctly.

ChrisKennedy’s picture

Status: Needs review » Needs work
StatusFileSize
new54.06 KB

Whoops, ignore this comment - meant to post it to the tests issue.

ChrisKennedy’s picture

Ok, actually trying this patch it looks like it doesn't apply cleanly to the codebase - appreciate the work here though. I'm getting hunk failures in advpoll.info, advpoll_field.info, and advpoll_ranking.info right now.

tripper54’s picture

Status: Needs work » Closed (fixed)

Closing this as most of this work has been done through other commits.

jacob.embree’s picture

Title: Cleanup code - separate into files » Cleanup code
Status: Closed (fixed) » Needs review
StatusFileSize
new145.96 KB

Here is an updated patch. A lot was done, but there's a lot left.

tripper54’s picture

Status: Needs review » Fixed

Great work, thanks for taking the time to do this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.