Might not be as bad as it looks, but good to see this module run through Coder to see that it fits with the D7 coding standards:

Status message
Coder found 1 projects, 16 files, 6 critical warnings, 5 normal warnings, 0 warnings were flagged to be ignored