The code isn't terrible, but it's not clear to you because you don't have the necessary information. The Total.js UI library (jComponent) is now 50% backward compatible with the UI library that you opened in 2014! You must know that we want to keep long-term backward compatibility. It's not a 100% nice code and of course, we will release a new version v20 (of UI library) this or next year cleared from the older code. We must offer stable tools for development, and that's critical for us and our customers.
This platform has been developed for around 10 years, and it isn't easy, but we will keep doing this since it is our hobby.