Statically generated call graph

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

On 12.12.2007 08:35, Martin DeMello wrote:

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

On Dec 12, 2007 1:29 PM, Robert K. [email protected]
wrote:

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 :slight_smile: 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