It's probably easier to do that than to muck around in the 2000-line version hoping you don't screw something else up.
It's probably easier to do that than to muck around in the 2000-line version hoping you don't screw something else up.
Making the assumption that anybody is capable of sufficiently testing such functions and subsequently re-writing them will only introduce new bugs and old regressions.
Seems harsh, but I've had to work with a few such monstrosities. Global state galore.
2000 lines of code is a massive amount of behaviour to understand. There's a minuscule chance you can infer all that behaviour from reading the code unfortunately.
It's basically an abstraction over the entire database layer, that has probably over 30 toggles that denote where and how it should fetch data, given a table name and a function call.
And every database call in the entire project is dependent on it.