tracker issue : CF-4104256

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] ER for: getTagList()

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 01/06/2016

Components: Language

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Win All

Vote Count: 0

getFunctionList() is useful for determining what functions were added in each version/update.

getTagList() would be useful for the same.

It should return a list (not a struct like getFunctionList() does; and, of course, getFunctionList() should return a list).

Example: "cfabort,cfajaximport,.."

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4104256

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:

Attachments:

Comments:

Actually, please do not consider this ticket yet. I now have a different idea which I would like to discuss in the PR. Thanks!, -Aaron
Comment by External U.
4930 | January 06, 2016 03:24:39 AM GMT
I'd prefer that Adobe adds a "isReservedWord()" function that will return yes/no and, if found, the category of reserved word and maybe the version it was introduced. I was negatively impacted when I tried to update CF Server and Adobe had added new reserved words in ColdFusion that matched functions and variable names I was already using. (Some words were only reserved if used within certain contexts.) I inquired if they had an official list of all of the reserved functions, tags, operators, scopes, prefixes, suffixes, etc and I received no support or interest. I wrongly assumed that isValid("variablename") would reject variables names like "eq", "trim" or strings that start with "cf_". Their own function doesn't take its own language rules into account when determining if variable names are valid valid or not. As a result, I wrote my own UDF and also included some words from Railo & SQL... but I haven't updated it in many years and many of the links I gleaned my information from are probably "404" now.
Comment by External U.
4931 | January 06, 2016 08:58:10 AM GMT
Doesn't the code analyser in CFAdmin cover this ground, James?
Comment by External U.
4932 | January 06, 2016 10:21:39 AM GMT
No. Have you tested it? Some errors may only occur when reserved words are used in specific contexts. As an example, I created a poorly named "NE" variable. Official Adobe documentation states that operators (specifically listing NE) are reserved and "must not be used". https://helpx.adobe.com/coldfusion/cfml-reference/reserved-words-and-variables/reserved-words.html ColdFusion validates it as a acceptable variable and and performs the variable assignment. Code Analyzer (in CF10) doesn't flag it as a potential error or provide an info-level warning. This is only the first reserved word that I've tested after you recommended using Code Analyzer. <cfscript> NE = 1; writedump(variables); writeoutput("isvalid('variableName', 'NE') = #YesNoFormat(isvalid('variableName', 'NE'))#"); NE = NE + 1; writeoutput("<br>NE+1 = " & NE); if (NE GT 1){ writeoutput("<br>NE is greater than 1"); } else { writeoutput("<br>NE is not greater than 1"); } </cfscript> Using the variable "To" normally isn't an issue, until you use it as a query columnname and try to reference it in a query-of-queries. (Adobe docs state "Avoid them [reserved words] in variables used in all queries. Do not use these keywords as variable names in any queries." It always comes down to the context and you never catch it until the first CF error is logged.
Comment by External U.
4933 | January 06, 2016 11:15:04 AM GMT
Right. So it demonstrates there is no problem using a variable called "NE" in the situations you describe. This demonstrates the issue is rather more perhaps that unilaterally describing something as being reserved is not actually that accurate or helpful, because *as you yourself say*: context matters. Accordingly using something like the code analyser - which takes context into consideration - is the appropriate tool for the job here. It's not an exercise in proving that some arbitrary list of items marked "reserved" is accurate or otherwise: it's a test of whether your code actually works.
Comment by External U.
4934 | January 06, 2016 11:53:33 AM GMT
Adobe, This ticket can be closed as duplicate of just-filed CF-4104564. Thanks!, -Aaron
Comment by External U.
4935 | January 06, 2016 05:05:57 PM GMT
We can consider this for the next release.
Comment by Vamseekrishna N.
4936 | January 07, 2016 03:01:59 AM GMT
Hi Vamsee, Thanks very much. Just FYI, CF-4104564 covers returning the tag list. It also covers returning the function list and member function list. As well as returning the reservedword list (as suggested by James below). Instead of having separate functions for all these, I filed CF-4104564 for a single function or SERVER-scoped variable to return a struct of all these lists. Thanks!, -Aaron
Comment by External U.
4937 | January 07, 2016 03:21:35 AM GMT
@Vamseekrishna Nanneboina,did you actually read what Aaron's last comment was?
Comment by External U.
4938 | January 07, 2016 03:22:03 AM GMT