User:Salvatore Ingala/Review 1

(in progress)

Use OOP, Luke!
Static stuff like getGadgetPrefsDescription is simply creepy, why not $gadget->getPrefsDescription? Further points dduced for duplication: the same function uses Gadget::loadStructuredList, then iterates over the array, then does its job. Let's see the callers... bah, ApiGetGadgetPrefs does the same!
 * ✅ in . Salvatore Ingala 18:06, 15 June 2011 (UTC)

Gadgets_body.php

 * This thingie had grown to the point where it could make sense to split it into several files.
 * Profiling: add wfProfileIn/wfProfileOut wherever appropriate.
 * SQL injection via gadget name in getUserPrefs/setUserPrefs
 * Why duplicate stuff from class User here at all?
 * ✅ in : now using UserLoadOptions and UserSaveOptions hooks instead of direct DB access. Salvatore Ingala 17:07, 16 June 2011 (UTC)
 * Verify that all existing gadgets will survive wrapping into yet another closure.
 * Once getGadgetPrefsDescription has been turned into a member function, cache its result.

Other

 * I don't know how stuff works if there are no unit tests. It may work, but sometimes things work accidentally.
 * Don't use wfMsgInSaneNameThatIsAlsoLong-like functions, there's Message class for new code.