CFLint
CFLint copied to clipboard
UNUSED_LOCAL_VARIABLE ignores variable usage inside of QueryExecute (QoQ)
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.
This issue should be a tough one, since the variable usage is inside a QoQ string. I doubt a QoQ string parser already exists!