A few weeks ago I had to reproduce one of the recent papers on deep learning theory. It had ~3000 lines of code over around 10 files, but when I just removed stale and unused calls and spaghetti (just like static analysis does), it reduced to ~1000 lines with identical functionality.
Original code also computed the most time-consuming routine twice to thrice each run and had many many typos, e. g. "calculte_infomration". Imagine this, but in every second function/variable.
Original code also computed the most time-consuming routine twice to thrice each run and had many many typos, e. g. "calculte_infomration". Imagine this, but in every second function/variable.
However, it worked.