Our great sponsors
-
GildedRose-Refactoring-Kata
Starting code for the GildedRose Refactoring Kata in many programming languages.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I have seen Sourcery (https://sourcery.ai/) do wonderful tricks with unraveling code like this, but that is unfortunately only for Python. But maybe you are lucky and can find something similar for TS.
You can also start with approval tests and try to reach 100% code coverage, then start refactoring. The Gilded Rose kata from Emily Bache explains this in detail (https://github.com/emilybache/GildedRose-Refactoring-Kata). Spending a bit of time on that kata can really help you tackling this mess. They have a video series of this kata on Youtube (https://www.youtube.com/watch?v=zyM2Ep28ED8).