may be we could consider using CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name') instead of fetching the contribution status again. 
Also this can be moved above the foreach at line 175 to prevent multiple function calling.