Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

schwern (1528)

  (email not shown publicly)
AOL IM: MichaelSchwern (Add Buddy, Send Message)

Schwern can destroy CPAN at his whim.

Journal of schwern (1528)

Thursday January 03, 2008
10:54 PM

I Want This Code Visualizer

[ #35283 ]

I want this. A thing that let's you visualize how the routines in your program are interconnected and how complex your routines are.

In particular...

* Lines pointing from the current routine to other routines it uses.
* Lines pointing into the current routine from other routines which use it.
* Lines connecting any global (which includes lexicals scoped outside a routine) your touine uses to all other uses of the global to show just how they interconnect (and toss encapsulation out the window).
* A visualization, either with color or length, of the length of each routine.
* A visualization of how deeply nested a routine gets.

Those last two, in particular, are really good, cheap indications of complexity.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I tried something similar in PerlySense, but I consider it a failed experiment.

    In the Overview, there is (well, was) a Signature Survey [] of the file, i.e. a char for each type of "thing" in the file (pod blocks, subs, statements, string literals, etc). Like this:

    * Structure *
    };';}S{;";"";;}S{;' {}{"};;;}S{;;;;";";;};

    I got the idea in an interesting article about Software Archeology [].

    I had hoped it would give me a kind of ambient feel of the structure

  • I have only seen something that breaks code into a flow chart. Nothing so fancy as what you want to see.
  • I saw this [] on Reddit just now.

    More cool than useful perhaps, but definitely very cool :)
  • Many years ago I was having trouble remembering how my code interacted with itself, so wrote this []. It produces a text report of what subroutines call what subroutines, and what subroutines are called by what subroutines.

    The code is hideous, and I wouldn't dream of writing it that way now, but on the other hand it does mostly work, and might make a good starting point. If anyone wants to have a go at improving it, be my guest.