Search code examples
coldfusioncfmlcoldfusion-2016cfloop

ColdFusion 2016 has modified the usage of CFloop tag returned by Code Analyzer


I tried to run the ColdFusion Code Analyzer over my entire project to check if there are some issues reported and for every single CFLOOP used with queries I got this warning:

ColdFusion 2016 has modified the usage of CFloop tag. How to fix: Check the usage of the tag CFloop.

I repeat, I got this warning for all instanced of CFLOOP in my files and they look like:

<cfloop query="getSampleItems">

I have no errors in my code, everything works fine. I wonder why CF is saying I am not using correctly CFLOOP tag. Any ideas?


Solution

  • Short answer, nothing is wrong

    Long answer: <cfloop> changed for arrays and lists. It is possible that if you were using <cfloop> in an array or list, you would have to change things. There is also a possiblity that you may want to run through your query as an array instead of a query.

    I suspect that none of these apply to your code, hence consider this to be a false positive.

    Source: https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-j-l/cfloop-looping-over-a-list-a-file-or-an-array.html

    enter image description here

    enter image description here