cflint / CFLint

Static code analysis for CFML (a linter)
BSD 3-Clause "New" or "Revised" License
174 stars 84 forks source link

MISSING_VAR incorrect in array loop #720

Open wporter82 opened 1 year ago

wporter82 commented 1 year ago

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.

KamasamaK commented 1 year ago

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