statically generated call graph

M

Martin DeMello

Is there anything out there that will statically analyse a ruby
project and spit out a call graph? It needn't be 100% complete or
accurate, just static (all I could find from google was profilers that
spat out call graphs in passing)

martin
 
R

Robert Klemme

Is there anything out there that will statically analyse a ruby
project and spit out a call graph? It needn't be 100% complete or
accurate, just static (all I could find from google was profilers that
spat out call graphs in passing)

I don't think there are any. The issue is, how do you want to do that?
Since you have no type information you cannot generate this graph - or
the graph will be so large that most branches are never traversed. For
example, what do you expect such a tool to output for this:

def f(x) x.to_s end

Basically, since you do not know what x will be you have to put in all
classes #to_s method etc. Am I missing something?

Kind regards

robert
 
M

Martin DeMello

I don't think there are any. The issue is, how do you want to do that?
Since you have no type information you cannot generate this graph - or
the graph will be so large that most branches are never traversed. For
example, what do you expect such a tool to output for this:

def f(x) x.to_s end

Basically, since you do not know what x will be you have to put in all
classes #to_s method etc. Am I missing something?

Oh - good point :) Didn't think it through enough - I was thinking
more along the lines of determining which methods within a class did
and didn't depend on other methods from that class.

martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top