Title: So, I've just inherited a very large, very badly written monstrosity. Including javascript, template files etc, it breaks the 1 million LOC barrier. I'm looking for some advice and strategies that you guys might have used in similar situations, in particular on:<p>- getting a handle on the code base
- communicating 'progress' to the client
- not losing the will to live<p>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.<p>Words fail me trying to describe the state of the software.<p>- 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<p>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.<p>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.<p>I wont mention the table-based HTML, javascript, lack of version control etc.<p>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.<p>Help me HN - you're my only hope.
(PS. 2K char limit sux)
Upvote: