[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

statically generated call graph

Martin DeMello

12/12/2007 7:36:00 AM

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

2 Answers

Robert Klemme

12/12/2007 7:57:00 AM

0

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

Martin DeMello

12/12/2007 8:52:00 AM

0

On Dec 12, 2007 1:29 PM, Robert Klemme <shortcutter@googlemail.com> wrote:
>
> 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?

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