Skip to content

New varScoper release candidate

by Mike on June 25, 2008

A new release candidate is available for my varScoper tool.

Please download and run against your code. If you find any issues please report them at RIAForge.

Thank you to everyone who provided feedback on 1.21. At least 16 bugs were identified and are now fixed in the RC. All reported issues and corner cases have been added to the unit test to ensure that it won’t break the same way in the future. Additionally, thank you to Pat Santora, who was responsible for a majority of the fixes.

Finally, based on feedback, I’ve included a cfset statement generator to generate blocks of cfset var statements. However, I take no responsibility for the consequences of using this generated code.

From → varscoper

  1. Thanks Pat and Mike, can’t wait to have a look

  2. Does this new release properly var scope cffile, and cfhttp, etc?

  3. Dmitriy Goltseker permalink


  4. cfhttp is now caught, cffile should have been working all along. So yes it should catch cffile and cfhttp.

  5. Dave Justin permalink

    Hey Mike, is there any support for firing off varScoper from ANT yet? Would love to get this in with our integration process.

  6. Dave-
    I’m going to include support for ANT in 1.30 (it’s actually in there now, but without instructions). If you take a look at the build.xml file you can probably figure it out.


  7. False positive for qJars in this scenario:
    var qJars = 0;

    <cfdirectory action="list" name="qJars" directory="#path#" filter="*.jar" sort="name desc"/>

  8. Matt-
    Is there additional code that you didn’t include that causes the false positive? Also, are you sure that you checked "parse cfscript" when you ran it? I just created a test case locally and it seems to run fine without false positives.

  9. My fault. I did not have parse cfscript checked.
    I guess I saw "experimental" and glazed over it.

    False positive not found when checked.

    Thanks, awesome tool. Really fast

  10. Mike Fransblow permalink

    Thank you Pat and Mike – this is a super cool tool, very much appreciate the work you put into this.


  11. Rick-
    I’d love to add that in, however, comments have proven to be extremely difficult to parse with regular expressions. As soon as I can figure out a reliable expression to use I’ll include this feature by default. I’d love any help that I can get.

  12. Rick Mason permalink


    This is super useful tool that I don’t know how I lived without. One useful addition for me would be a check box that allowed it to ignore violations that occur inside comments

  13. The Frog permalink


    i try your varScoper.
    Very nice !!!

    I have an unscope variable but i don’t know how to scope its…

    <cfinvoke method="getQStat" returnvariable="qStat">

    Can you help me pleaz?

  14. In that example, the code to locally scope the variable to your function would be….

    <cfset var qStat = "" />

  15. Jason permalink

    I read somewhere that you were intending to provide more ANT support / instructions but I don’t see that in the latest release (1.3). Is this still a plan?

    Also, I don’t see updates in the history section of the readme file. Curious to read what changed . fixed etc.

  16. Thanks for the great tool –
    When I just updated to 1.3 I get a ‘java.lang.OutOfMemoryError: Java heap space’

    The prior version i was able to process this:
    Processed 179 files and 2211 cffunctions in 14843ms

    When I revert back to the 1.2 release and run – i’m able to execute the scoper on the entire dir. As soon as I put the updated 1.3 release back in – I get out of memory issues.
    (link to dump file)

    Here’s my jvm config locally
    java.args=-server -Xmx256m -Xms256m -XX:MaxPermSize=256m

  17. Have you been able to narrow the Out of Memory exception down to a single file? It wouldn’t surprise me if it is choking on a very large cfc. Also, have you tried expanding your heap? Try it again with -Xmx512m -Xms512m.

  18. Yeah it took a bit more juice this time to make it work – throwing more memory at the problem solved it nicely –

    Processed 179 files and 2211 cffunctions in 54281ms

Comments are closed.