[Zope-dev] find unused objects: hopefully the last misunderstanding... :o)

Oliver Bleutgen myzope@gmx.net
Fri, 30 Aug 2002 18:46:57 +0200


R. David Murray wrote:
> On Fri, 30 Aug 2002 THerp@apriori.de wrote:
> 
>>Consider a tab for methods... which allows to parse them and produces
>>a sortable list of links to the other referenced methods...
> 
> 
> Good luck <grin>.  You might manage a Quick and Dirty implementation,
> but to guarantee you've not missed anything you pretty much have to
> run the site as a program, which leads you to the classic computer
> science halting problem, I think.  And that still doesn't address
> the question of external references.
> 
> 
>>By the way, new question:
>>Is this the correct mailing list for such suggestions?
>>If not, which one is it?
> 
> 
> For the original "has anyone implemented" question, probably 'zope'.
> For a discussion of how to implement this (or rather the effective
> impossiblity of implementing this reliably) this is probably the
> appropriate place.

Ok, quick and probably dumb idea how one could write a "ZLinkBot".

If there is a central part in zope (ZPublisher?) which always runs when 
methods/scripts/etc  are called, one could patch it to also log the path 
of the object which is called (the physical path!).
Then just use a web spider which crawls the whole site, and after that 
compare the list which has been produced by the method above to the list 
of objects in your ZODB.

Everything which hasn't been touched is an orphan.

Could ZPublisher.Publish.call_object() be that central piece of code?


cheers,
oliver