Thanks I have had a quick look at code explorer and there are some issues. The greatest for me is that it does not identify where one class calls another class. It is this chain of class A calls class B ... calls class Z that is causing me the greatest issues. It also incorrectly reports recursive calls that are not. For example

class Fred
  def initialize
    @socket = Socket.new
  end

  def close
    @socket.close
  end

  def fred
    puts "Hello World"
  end
end

The close method from Fred will be reported as a recursive call when it is just named the same in a different class. This makes the diagrams less useful

For the example above output like below would be a great step forward to building the graph I need. Fortunately the codebase has lots of class methods

class Fred
  method initialise
    ref Socket
  method close
    call Socket
   method fred

Code mapper looks interesting as it is built from a runtime trace but assumes that I can get this POS to run 😤

I think that I am going to have to look into the parser gem and put some code together

Thanks for the suggestions, I will likely be looking through them to write my own


On Tue, 6 Feb 2024 at 14:04, Frank J. Cameron via ruby-talk <ruby-talk@ml.ruby-lang.org> wrote:
On Tue, Feb 6, 2024, at 6:15 AM, Peter Hickman via ruby-talk wrote:
> I have some old code to work with that is more than a little over
> engineered.
> Is there a tool that would allow me to graph this so I might see where the
> actual work is being done and shorten these branches?

TracePoint -> Graphviz:
https://github.com/cjoudrey/code_mapper

Parser -> Graphviz
https://github.com/mvidner/code-explorer
 ______________________________________________
 ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org
 To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org
 ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org/