On 11/28/19 8:25 AM, Richard Gaskin via use-livecode wrote:
Quentin Long wrote:

 > Finding explicit function/command calls seems like it should be a
 > fairly straightforward task. However, the "do" keyword can also be
 > a source of function/command calls, which complicates matters a
 > wee bit. You'll also need to evaluate all the non-cleartext components
 > that can go into "do" statements—
 > do (VariableName)
 > do (the WhateverProp of ThisObject)
 > do (line 4 of fld "ThisField")
 > —etc etc etc.

There are many reasons to resort to "do" only after all other more with-the-grain approaches cannot be made to work.

That it eludes static code analysis is just one more.

If I get around to tidying up my old orphan-finder and adding it to other code base management tools in devolution, I wouldn't bother attempting to handle "do" cases.  Low ROI, and not handling them helps draw attention to the technical debt many uses of "do" accrue.


Somewhat similar problem with "send" and "dispatch" commands as well. You can alleviate this a bit during parsing by seeing if what follows the "do" or "send" or "dispatch [function]" command is a quoted string.

--
 Mark Wieder
 ahsoftw...@gmail.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to