- getting a handle on the code base
- communicating 'progress' to the client
- not losing the will to live
The software is based on vtiger, an open-source CRM that has a (deserved) reputation of being incredibly badly written, that has since been badly hacked apart by several different companies with wildly differing ideas. My client currently have 150+ installs and 150+ angry clients.
Words fail me trying to describe the state of the software.
- no niceties such as MVC, ORMs, a DBAL, or a modular design
- all DB queries are inline SQL, with tens of inner joins on most queries
- dizzying call stack, yet reams of copy+paste code
The best part: the code will often query the DB and execute PHP code contained in the response, or load and run arbitrary files and modules as dictated by parsing particular DB fields. The one page I have studied in detail generates 105 DB queries in the simple case.
The DB itself is even worse. There are over 600 tables, as well as views, custom functions, cascades and (but of course) triggers. There is no consistent naming schema, very few explicit foreign key references (despite being heavily, heavily entwined) and I have already discovered several tables that don’t have primary keys, but are referenced by exact string matches on things like date stamps.
I’m not sure if its even possible to give relevant advice (besides perhaps ‘run screaming’), but if anyone here has come through a similar situation and has any advice to share, I would be deeply grateful.
Help me HN - you're my only hope.
(PS. 2K char limit sux)