Code characteristics:
- Written in PHP (but suspect code author had more background with assembly code...)
- Imperative, almost procedural.
- 3 500 lines of code in single file
- Switch takes 2 000+ of those lines
- Code is written in imperative non-procedural style inside case statements
- No tests what so ever.
App logic is organized so that there is single function action that take action name. This big switch is used for decided what logic to do for given action name. Most actions invoke action function on their own to finish the task.
Questions are:
What techniques can I use to move that code toward more procedural style?
Are there any PHP tools that would give me list of cases that are not ending with break?
Advice on writing tests? (Again no classes mean most of the advices out there are useless or at least vary hard to apply)
