varscoper and ColdBox question

I've seen varscoper recommended several times in this group. I've
tried to use it but it seems to not like my code. When I run
varscoper against my coldbox app, it never reports any unscoped
variables even if I deliberately introduce one. I write all my
handlers and models as "pure" cfscript (no cffunction tags). Is it
the case that varscoper depends on finding code inside of cffunction
tags or am I missing something?


well, I think that unfortunately using varscoper with cfscript is not that accurate.

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:


For what it is worth, I now use explicit variable declarations everywhere, for all scopes. Not only has this practice prevented me from wondering if things are locally scoped (because I use using explicit scopes for all variables has helped me read old code faster as I make updates.


Aaron Greenlee

That should be automatic by every developer, the amount of times I have been given work to do and have to work out whether the variables is in application or some other scope wastes too much damn time.

Especially when looping through queries, a lot of developers get lazy and don’t prefix it with the queryname, and when you mix normal variables that are not scoped with the queries going back and forth to figure out which variable is coming from where is only going to make me curse the previous developer.

I seriously wished that ColdFusion was strict on this, and refuse to run without proper scoping.

Well, I disagree with the use of the local scope. It’s unnecessary clutter. Especially, for people writing tag-based components.

Jason Durham


Do you have any specific cfscript code samples that you'd be willing
to share? If you could add them to the issue tracker on riaforge
( I'll make
sure to add them into the test cases and see if we can get them fixed

-Mike Schierberl

My ColdBox code is a mix of pure tag, pure cfscript, and mixed tag and
script. The varscoper cfbuilder extension worked great (!) on my pure
tag code. I'll put together some samples of what I get with the other