D
D
Dmitry Larin2017-09-29 15:16:49
PHP
Dmitry Larin, 2017-09-29 15:16:49

How to refactor files into a couple of thousand lines?

It was a simple 3 page website. Now it is a complex site on 3 pages. Bek has grown from a couple of php files into a hundred complex files in three years. Integration with srm, sms, telephony, instant messengers and hell. Added agency and partner cabinets. A bunch of webhooks, widgets...
In general, there are many files with complex logic on the back. some of them are 500 line switch statements. Which side to approach the refractor of such files?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita Dergachov, 2017-09-29
@fanrok

1. You open a file.
2. You read the code.
3. Trying to understand.
4. Write tests
5. Refactor.

A
Alexey Skobkin, 2017-09-29
@skobkin

Decomposition .

L
Lander, 2017-10-19
@usdglander

It is worth starting with the study of refactoring methods.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question