varScoper 1.20 - critical update

Version 1.20 of varscoper is now out on RIAForge. It's also available directly from the download link.

Many thanks to Pat Santora for this release. The majority of the content in this release is a direct result of his hard work.

Updates

  • Improvements to cfscript parsing engine
    • RIAForge issues 6,7,8,9,10,11 are fixed
    • Improved handling of script comments
  • Ability to exclude files/folders
    • configured through properties.xml
    • Ability to exclude individual files or directories from your search
  • Integrated Unit Testing
    • testCaseCFC.cfc now includes positive/negative test cases for all reported issues
    • Currently still reporting 2 known issues that will be addressed in a future release
  • Improvements to parsing engine
    • Fix for Ray's cffeed bug (also fixes cfprocparam)
    • More agressive var scope checking (re-run against all your code, we found 2 new unscoped vars at Planitax)

Minor update to varscoper

I just released a 1.12 update to my varscoper tool.  I've added new tags to the parsing engine, added XML output support, and fixed some bugs related to directory parsing in CF6.  Thanks to Kola Oyedegi for help with XML output and Dmitriy Goltseker for fixing directory processing.  Thanks to everyone who helped to refine the list of tags that create variables.  The additions are below.  You can also download 1.12 here , or get it via SVN on riaforge.

  • cfhttp:result
  • cfquery:result
  • cfimage:name
  • cfmail:query
  • cffeed:name
  • cffeed:query
  • cfftp:name
  • cfwddx:output
  • cfobject:name
  • cfsearch:name
  • cfprocresult:name
  • cfpop:name
  • cfregistry:name
  • cfreport:name
  • cfdbinfo:name
  • cfdocument:name
  • cfexecute:variable
  • cfNtAuthenticate:result
  • cfcollection:name
  • cfpdf:name
  • cfxml:variable
  • cfzip:name
  • cfldap:name

Can you name all the tags that create variables?

As part of the development effort on my var-scoping tool I have been trying to identify all of the tags that can create variables.   I have yet to find a comprehensive listing of tags, so I'm hoping that people can leave comments here to expand the list.

Here's my partial list to start with (yes I know it's small), along with the parameter that specifies the variable name.  Please comment on my blog and add on any that I've missed.

cfloop:index
cfloop:item
cfquery:name
cfinvoke:returnvariable
cfdirectory:name
cffile:variable
cfparam:name
cfsavecontent:variable
cfform:name
cfstoredproc:name
cfprocparam:variable

varScoper 1.1 - now with cfscript parsing

That's right, my varScoper tool now supports cfml written within cfscript blocks.  Please note that this is still somewhat experimental, but seems to handle quite a few scenarios.

Click here to download the 1.1 code.

Here's a link to the project page.

Many thanks to Zac Spitzer who is responsible for writing the code to identify var statements within cfscript.  He completed the cfscript var statement support as a response to this post

After looking at Zac's code, I decided to take it to the next level and complete the code required to identify variables created within cfscript blocks.

The code will even ignore variables created within comments, but unfortunately does not include the ability to identify the line number of the variable (which it does within tags).  You can still jump directly to the method, but you're on your own to find the variable.

You can even identify variables created within for loops and if/else blocks.  Here's an example...

for(correctLoop=1;correctLoop LTE 10; correctLoop=correctLoop+1) correctSimpleVar = correctLoop;

In this example correctLoop, and correctSimpleVar will both be identified with the tool.

For those of you who aren't aware of varscoper, it is a code analyzer that will look for variables without a var statement that exist within a cffunction.  I released the tool last July and cfscript support has been the #1 request.

Additionally, I am now hosting the project at RIAforge at http://varscoper.riaforge.org/, you can look there for SVN access.

Please take a minute to test out the code and please let me know ASAP if you can find any cases that the cfscript code doesn't cover.

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner