varScoper 1.0 release
Today I am releasing version 1.0 of a project that I’ve been working on for a few weeks. It’s a cfc that can be used to parse cfm and cfc files and identify variables that haven’t been locally scoped within cffunctions.
varScoper can do the following….
- Find unscoped variables created with a cfset within a cffunction
- Find unscoped variables created with cftags (cfloop, cfquery, etc)
- Report line numbers and link directly to the line in the file
- Output to screen or csv
Hopefully everyone else will find this as useful as I do. There’s a link in my projects section to the project page, or you can follow this link.
You might be surprised at the results you find. I’ve been careful to scope my vars within the last few years, but I found an alarming number of potential problems in some of the code I was writing a few years ago when I first started with CFCs. In any case, try downloading the sample code, run it against your codebase, and do some housecleaning.
Here’s a screenshot