Unused Methods

Richard Gaskin ambassador at fourthworld.com
Sat Jun 6 13:05:00 EDT 2015


Mike Kerner wrote:

 > On Sat, Jun 6, 2015 at 9:29 AM, Terence Heaford wrote:
 >
 >> What made me ask this question is because of the amount of time
 >> it takes the IDE to find and list methods that I ask it to find.
 >>
 >> This would be an acceptable way of working if it wasn't so slow.
 >
 > I'm not trying to be a smart-ass with this, so don't take this as
 > some dismissive remark.

Given your helpful nature and your contributions to this community I 
don't think you need to worry about anything you write being seen as 
dismissive.


 > The easiest way, IMHO, to do what you are suggesting, is to add some
 > code to the script editor that will index every handler (and every
 > keyword, taking it to a logical conclusion), and index them.

Respectfully, I believe it can be even easier.

I've written a few search engines so I'm a big fan of up-front indexing, 
but where we can brute-force our way through a task in acceptable time 
the simplicity afforded is often well worth a modest wait.

LiveCode is very good at parsing text, and scripts are of course just 
text.  The types of analytics useful for LiveCode project management 
aren't much different from the many other categories of activity LC is 
well suited for.  And given that LiveCode already has a good 
understanding of its own objects, tools for managing LiveCode projects 
are often easier than other things we enjoy using it for.

I would be interesting to learn more about the areas where Terence has 
found it slow to do these sorts of things.  I'll bet there are ways to 
speed that up.

For many years a lot of new work I was doing started with inheriting 
code bases written by others, so it became useful to have a tool that 
could give me an overview of some aspects of the code base by performing 
static analysis of the scripts.

Here's that thrown-together result:
<http://fourthworld.net/lc/4w-projprofiler.png>

Going forward, as time permits I'll be expanding that to include a much 
more useful presentation with more info, but this primitive early form 
is noteworthy here if only because it uses very old and sloppy 
techniques that I know can be made much faster.

And that sloppy version takes about 1 second to run on the 13 KLOC code 
base shown.

For the info it provides, well worth the onerous wait. :)

I see many good static code base analysis tools for other languages, and 
there's no reason we can't have lots of them for LC too.

I haven't seen a language with a built-in function for finding orphaned 
handlers across a code base, but Terence if you can point me to one I'll 
see if I can include that in this LC PM toolkit.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list