New MISSING_VAR false positives in 1.3.0 around cfscript/tag syntax
See original GitHub issueACF, here are a few examples of new false positives (150+ in my codebase) I just found 😕
They never triggered false positives in 1.2.x. but do now in 1.3+
var qGetSites = new Query(datasource="...", sql="...");
Variable datasource is not declared with a var statement, same for “variable” sql.
var mailService=new mail(
to="...",
from="...",
subject="...",
type="HTML",
body=mailBody
);
all 5 valid attributes here trigger now MISSING_VAR
var httpRequest = new HTTP(
method = "get",
url = ("http://api.pusherapp.com" & resourceUri),
charset = "utf-8"
);
method and charset trigger a MISSING_VAR, url doesn’t. No idea why.
var httpRequest = new Http(method=arguments.method, url=variables.ENDPOINT & arguments.resourceUri, charset="utf-8", timeout=arguments.timeout, throwOnError=false, username=variables.something, password=variables.somethingelse, getAsBinary="never");
charset, throwOnError, username, password, getAsBinary trigger MISSING_VAR
application.facebookSDK.facebookApp = new facebook.sdk.FacebookApp(appId=application.config.FBPhotoEndpoint_APPID, secretKey=application.config.FBPhotoEndpoint_SECRET_KEY, apiVersion=application.config.FBPhotoEndpoint_Version);
Reports MISSING_VAR on each of the constructor arguments appId, secretKey, apiVersion
void function setCallerVars(data, row, getRow, columnNames){
var rowData = getRow(data, row, columnNames);
for (var col in listToArray(columnNames)){
if (isQuery(data) && ListFindNoCase(data.columnList, col)) {
caller[col] = rowData[col];
}
}
caller["currentRow"] = currentRow;
}
The above is in a custom tag. Reports on “caller” for MISSING_VAR. “Caller” is a scope similar to thisTag in a custom tag and should then not report MISSING_VAR.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
Pretty sure I got the issue with a local build of the dev branch. Your tests look like my scenarios - I’ll look closer into that later today or on the weekend - weird.
I think this can be closed and included in 1.4.0