Upcoming update to the Var Scope Checker

While helping a user on IRC, (dalnet #ColdFusion) I was looking for the Var Scope Checker. In my hunt to find the darned thing, I saw in the comments of Matt Woodward's blog that Seth Petry-Johnson is planning on updating the Var Scope Checker.

If you aren't familiar with the var scope checker, it is a tool that scours your source code looking for unscoped variables. It is a reasonably intelligent tool in the current incarnation.

My only gripe with the tool is it isn't savvy in cfscript blocks. This is apparently set to change this weekend. Keep an eye on Seth's blog for the update.

If you are reading this and are a ColdFusion programmer and have no idea why you need this tool, please have a read at the following:

Seth, if you read this, please consider placing the tool on RIA forge. As it is now, I have to find your site, which throws an error, then walk down to the base directory.

Update: Mike Schierberl has another var scope checking tool found here. According to Mike, "I also developed a test case file that is useful for identifying cases that the tool should find. After installing varScopeChecker, I ran my testCaseCFC and it only found 16 of 24 unscoped variables.".
The test case is available here.

Please have a look at Mike's Var Scope tool.

Related Blog Entries

Comments
I added a file browser to my copy and wanted to give him the code but he never responded to my email.
# Posted By jim collins | 5/19/07 5:40 PM
@Jim,

Ohhh A file browser would be nice. Would you still be willing to make that code available?

DW
# Posted By Dan Wilson | 5/19/07 6:19 PM
The var scope checker is also built into Greg Stewart's Stubbie test stub generator. I haven't really taken a good look at Stubbie yet, but yo can find the project on RIAForge, http://stubbie.riaforge.org/.
# Posted By Nathan Mische | 5/22/07 8:37 AM
@Nathan,

Thanks for the information. I was not aware of the stubbie project. I am downloading it now.

Glad to have met you at CF.Objective(). I hope you got back safe and sound.

DW
# Posted By Dan Wilson | 5/22/07 9:21 AM
Nice done!
checked already some projects with really bad results, bad bad boy!

but one thing i wanted to ask, does it work with <cfscript>?

i decleare a lot of my variables inside
<cfscript>
var i = 0
</cfscript>

and i still get a warning on this variable.

Is it something you thought to do? I m sorry i don t have time this days but if I get some time on the next weeks I could check if this could be done.

thanks a lot

-daniel.
# Posted By Daniel | 5/22/07 9:31 AM
Hahaha... i just read your blog and saw that you have it already in your mind.
sorry... it s so tipical ... complain before reading the instructions...

nice done! thanks a lot

-daniel.
# Posted By Daniel again. | 5/22/07 9:33 AM
@Dan - Nice meeting you too. Glad to see you are now on the Goog!
# Posted By Nathan Mische | 5/22/07 10:15 AM
One additional note, I've also developed a tool on my own after talking to Seth around a year ago. Similar functionality, but with a slightly different approach.

http://schierberl.com/varscoper

I also developed a test case file that is useful for identifying cases that the tool should find. After installing varScopeChecker, I ran my testCaseCFC and it only found 16 of 24 unscoped variables. You can see the test case file here:

http://schierberl.com/varscoper/examples/fileDisplay.cfm?skipLineNumbers=true&fileName=%5CtestCaseCFC%2Ecfc
# Posted By Mike Schierberl | 6/11/07 4:00 PM
@Mike,

I ran across your version once but could no longer find it via google search. That is what I get for using "Var Scope Checker" as a keyword. Thanks for leaving the comment. I will update the post to show your tool.

DW
# Posted By Dan Wilson | 6/11/07 5:02 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.001. Contact Blog Owner