Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tool to generate flowchart from code?

I just joined a project made with Angular JS which has a lot of nested promises. Some tasks seem to not happen in the right order, which causes some object to be overidden at some point. I need to check how/when the promises are called, which are returned first, etc. A flowchart of what's going on with all these promises woudl help me a lot, unfortunately it would take me quite some time to do it manually, so i was wondering whether there is a tool to automate that. I've been looking on Google but can't find anything like that. Any tip about how to trace promise calls/responses are welcomed!

like image 297
Antoine Avatar asked Nov 10 '22 12:11

Antoine


1 Answers

Yes, such a tool exists - unfortunately not for Angular promises, and it's not in production yet - it looks something like:

enter image description here

See this Google+ post for a short video.

Unfortunately for you it's not available yet. The other tooling for Angular does not support this use case.

On the other hand - if you temporarily use Bluebird with Angular and you use the 3.0 branch of bluebird - it will automatically warn you about out-of-sync issues like creating promises and not returning them, passing incorrect values and so on in errors mode:

(Photos (and code :P) by Petka)

like image 144
Benjamin Gruenbaum Avatar answered Nov 15 '22 12:11

Benjamin Gruenbaum