Since there is no code collapse all and expand all in WeBuilder as far as I know and which it is indeed needed for future versions I decided to write a plugin to implement these commands. It's not optimized because it'll loop over all lines to see whether they are collapsible or not, but it won't take more than five seconds for over 6000 lines which I've tested, currently it'll collapse all collapsible lines like every curly brackets which you might find it bothering because I just needed to collapse functions. It's not that hard to do this, but it'll make it restricted to just functions and nothing else.
The plugin's name is (Editor) and that's because I was planning on to develop a series of useful commands titled as Editor's Extra Commands. It'll do the work for now.
Hope it'll come in handy for you.