cflint / CFLint

Static code analysis for CFML (a linter)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MISSING_VAR incorrect in array loop

wporter82 opened this issue · comments

When looping over an array of structs, setting any value of the local scoped struct will incorrectly be flagged as not being declared with a var statement

image

A workaround would be to add a new variable that we work with instead:

image

But this just adds complexity and possibly introduces potential bugs further down the line.

Another workaround is to reference it as local.xyz each time it is used.