I have a partial list of things I want to add to cfeclipse:

* Variable references to external scopes - URL, FORM, SESSION, ATTRIBUTES etc. without a cfparam declaration. (ERROR)

* Function local variables that have not been initialized. (ERROR)

* Unscoped references to variables inside function bodies. (WARNING)

* Unscoped references to variables anywhere. (WARNING)

* Direct references to external scopes from more than one file in a project (WARNING)

* Using variables for the paths to components, cfmodule calls and cfincludes (WARNING)

* cffunction tags without access, hint, and returntype attributes. (WARNING)

* cfargument tags without required attribute. (WARNING)

* Query variables not enclosed with cfqueryparam tags. (WARNING)

* Use of caller scope. (WARNING)

* Use of iif(). (WARNING)

* Use of cfinclude. (WARNING)

* Use of CFML inside HTML tags e.g. <body <cfif session.foo>bgcolor="red"</cfif>>. (WARNING)

* Use of cfoutput around a custom tag call or cfinclude. (WARNING)

* Nested cfloops with query attribute. (ERROR)

There are lots more, but those are the ones that I can think of off the top of my head.

The idea is to have a preference page where you can turn each and every one of them on or off. Any time the parser encounters an error it will put a marker in the line number ruler and where possible provide an option to autmatically fix the problem. Some things that could be automatically fixed are undeclared function local variables, references to external scopes without a cfparam tag, unscoped references to variables.

Spike

Haikal Saadh wrote:
Maybe we could get started by having a Wiki or something where we could start off by contributing sets of rules that such a framework would look for? There are a lot of sites out there with this information, albeit scattered around everywhere. And of course, it's hard to judge which versions of CF they apply to, as shown by the number of "Is this true for version X" type of comments these pages attract,

Off the top of my head, I would suggest:
* Un-var-ed  variables in function bodies
* Not using cfqueryparam.
* Warn when scopes locks are used (as opposed to named locks)
* Too much (how much is too much?) code within cfoutputs. Or <cfoutput query=""> * Suggest <cfsavecontent> rather than <cfset> when dealing with html. (Not really any danger, but it's a lot more readable, and cfeclipse likes that well formed markup better).

Of these, the first four have given us a _lot_ of grief, so it would be good if it was easy to avoid making these mistakes in the future.

Paul Hastings wrote:

Stuart Miller wrote:

I'd be interested in a tool like this even if it only checked function
bodies for non var declared variables. Notoriety awaits anyone willing
to build it!



i was just about to say the same thing. that kind of tool would go a long way towards building more stable apps.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]






--

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to