ColdFusion Muse

Var Scoper Tool

Mark Kruger June 19, 2008 2:55 PM Coldfusion Tips and Techniques Comments (1)

Mike Henke reminded me of this slick little tool called varscoper. Pass in a directory and it will ferret out all the places where variables are not correctly scoped. For example, it will sshow where you have not correctly var'ed variables in a function. The project was produced by Mike Schierberl who's blog has some excellent goodies and tips.

varscoper won't catch the cfhttp scope, but it would catch a variable declared as a result attribute. Either way, it could save you some headaches - especially when dealing with a large pool of code, or taking over someone else's code.

  • Share:

Related Blog Entries


  • Mike Schierberl's Gravatar
    Posted By
    Mike Schierberl | 6/19/08 1:47 PM
    A quick note on the cfhttp issue, if you specify a result attribute for your cfhttp call it will scan that as an unscoped variable.

    You are correct that it will ignore cfhttp variables. This scope was marked as an ignored scope originally and I'll probably change that in the next release. For now, you can remove cfhttp from the list of ignored scopes on line 47 of varscoper.cfc