CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

UNUSED_LOCAL_VARIABLE ignores variable usage inside of QueryExecute (QoQ)

Open jaredbeck opened this issue 6 years ago • 1 comments

  var genericData = request.newObj('dataloader').getData(redacted);

  return QueryExecute("
      select redacted, genericData.*
      from redacted, genericData
      where redacted
    ", {}, { dbtype: 'query' });
Message code:UNUSED_LOCAL_VARIABLE
        File:/Users/jared/redacted/redacted.cfc
        Column:6
        Line:78
                Message:Local variable genericData is not used in function getData. Consider removing it.
                Variable:'genericData' in function: getData

This issue is distinct from https://github.com/cflint/CFLint/issues/153. That issue also dealt with QoQ, but in <cfquery>, not QueryExecute.

jaredbeck avatar Jul 19 '19 20:07 jaredbeck

This issue should be a tough one, since the variable usage is inside a QoQ string. I doubt a QoQ string parser already exists!

jaredbeck avatar Jul 19 '19 20:07 jaredbeck