Identifying Un-used functions and commands

Paul Dupuis paul at researchware.com
Mon Nov 25 13:19:44 EST 2019


revRefactor has a very nice "orphan Code..." feature

https://github.com/mwieder/revRefactor/tree/master/Plugin


On 11/25/2019 1:08 PM, J. Landman Gay via use-livecode wrote:
> I think he wants it the other way around, identifying handlers and 
> functions that aren't called by any other handler. I've done this, but 
> only one at a time, by searching for the handler name across all open 
> stacks. If the only occurrence is the handler itself ("on/function 
> whatever", ) then it's unused.
>
> The method here would probably be to get a list of all handlers and 
> functions and then do a global search for instances of each. If 
> there's one or more that isn't the handler declaration, it's used.
> -- 
> Jacqueline Landman Gay | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On November 25, 2019 11:51:14 AM dunbarx--- via use-livecode 
> <use-livecode at lists.runrev.com> wrote:
>
>> Hi.
>> This was posted a couple of weeks ago, no?
>> I suggested then that you could write a short handler that loops 
>> through all the scripts in all the controls on all the cards, and 
>> isolate words that are not preceded by either "command", "on" or 
>> "function". In this way you might see, for example, that "myGadget3" 
>> may be present in scripts here and there, but there is no "on 
>> myGadget3" anywhere. Then you will have found an unused handler call.
>> This may require tweaking. For example, LC will compile, say:
>> "on         myGadget3"  -- spaces galore
>>
>> Craig
>>
>> -----Original Message-----
>> From: Bob Sneidar via use-livecode <use-livecode at lists.runrev.com>
>> To: How to use LiveCode <use-livecode at lists.runrev.com>
>> Cc: Bob Sneidar <bobsneidar at iotecdigital.com>
>> Sent: Mon, Nov 25, 2019 12:29 pm
>> Subject: Re: Identifying Un-used functions and commands
>>
>> Since there is code in the script editor that knows the location of 
>> any command or function you right click on, if you found out how they 
>> do that, you would be well on your way to developing a way to grok 
>> it. Also, GLX2 has a "clairvoyance" (Auto-Complete) function that is 
>> handler aware. I suspect Mark Wieder developed a method for getting a 
>> list of all handlers in a stack that is opened. That would probably 
>> help too.
>>
>> Bob S
>>
>>
>>> On Nov 12, 2019, at 09:12 , Stephen MacLean via use-livecode 
>>> <use-livecode at lists.runrev.com> wrote:
>>>
>>>
>>> Hi All,
>>>
>>>
>>> I’m wondering if anyone has a way or code to identify any un-used 
>>> functions and commands in a set of stacks?
>>>
>>>
>>> Best,
>>> Steve MacLean
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list