What's the state of the art in finding unvar-ed va...
# cfml-general
d
What's the state of the art in finding unvar-ed variables in CFCs? I'm not talking about unSCOPED, just vars presumably intended to be local, but missing
var foo = ""
or
local.foo
, so they leak into the shared
variables
scope of the CFC.
b
If you're using ColdBox, my singleton leak detector does a pretty good job of analyzing a running app
It looks for things in the variables scope of singletons which have appeared or changed since the class was created
r
I'm not sure if it checks for missing unvar-ed variables but you could try Fixinator. It might catch other things as well.
d
Not using ColdBox, but good to know. Not using Fixinator either, haven't gotten it sold it upstairs so far, we're a non-profit, so we only buy what we really need. We don't general keep CFCs in shared memory, so it's not so much of an issue, but someone started doing that, and I see they didn't dot every "eye", so...
z
Lucee 6.2 has a logging option to complain about all of em, or the good old debugging options
👍 1
d
Can you tell more about this logging option in 6.2? I’m not familiar with it.
t
Gareth's CFLint can do that well https://github.com/cfmleditor/cfmleditor-lint
👍 1
z
d
Huh, that’s pretty slick!
l
I’m surprised that no one has mentioned it, but Ortus Soslutions also has a very nice little standalone app called CodeChecker that should be able to check for unscoped variables. It’s very easy to use, and is very good for other issues with CF as well. Worth checking out: https://www.forgebox.io/view/CodeChecker
👍 1
b
codechecker packages the var scoper util, which I think may only work on tag based code 🤔
lol, the link to it is a dead link to riaforge 😕
r
It also requires ColdBox 5, according to the dependencies.
b
yeah, I haven't used the app version in years
The CLI is what we started using. It's powered by the same services wrapped up in the web app