Page 1 of 1

Help in refactoring code

Posted: Tue Apr 23, 2019 8:27 am
by kaveh1000
Hi all

I have a complex set of handlers calling each other. I want to refactor the code and make it simpler for me and others. I am having a hard time getting a picture of what is going on as I did not write in the most efficient way. Is there any way of visualising, say with a diagram, which handler is handling which, to help me unravel the structure?

Regards
Kaveh

Re: Help in refactoring code

Posted: Tue Apr 23, 2019 9:02 am
by richmond62
Why not be old-fashioned and draw a big flowchart on a large piece of paper:
has helped me several times.

Re: Help in refactoring code

Posted: Tue Apr 23, 2019 9:54 am
by kaveh1000
Primarily because I am lazy!!!

Yes, probably will do that. But I was wondering if there might be a script to reverse engineer the code I have and draw some kind of chart for me! That should be possible I would have thought.

Re: Help in refactoring code

Posted: Tue Apr 23, 2019 10:13 am
by Thierry
Hi,

Check for Mark Wieder last astonishing work !

He made a refactoring library not too long ago.

HTH,

Thierry

Re: Help in refactoring code

Posted: Tue Apr 23, 2019 10:20 am
by kaveh1000
Hi Thierry

I am indeed using Mark's generous gift to the community to rename clean up, move handlers, etc.

But it is not doing what I am asking for. Perhaps Mark has a suggestion?

Regards
Kaveh

Re: Help in refactoring code

Posted: Tue Apr 23, 2019 10:29 am
by Thierry
kaveh1000 wrote: I am indeed using Mark's generous gift to the community to rename clean up, move handlers, etc.
But it is not doing what I am asking for. Perhaps Mark has a suggestion?
Therefore, I kindly suggest to get in touch with Mark
who, if my memory is fine, is more active on the user's list.

and show him part of your code;
always more chance to have an answer this way :roll:

Best,

Thierry