I like CFLint for its ability to assist me in writing better code. But some of the rules implemented in the “standard” version strike me as arbitrary (“standard” meaning the version without any additions). If there is some kind of master rulebook for writing CFML or CFScript, then there is no reference to that in the CFLint source code, nor on its website.
I find that CFLint conflicts with some of the code style rules that I have been applying for over a decade. Code styles are always somewhat arbitrary, of course. They depend on the experience and knowledge of its author(s), on the frameworks and code libraries used, on the styles used in other programming languages at the same company, on the quality assurance rules applied, and more.
That is why I struggle with some of the rules currently fixed in CFLint. Here’s an example. When I write scope names like “APPLICATION” and “ARGUMENTS” the “VariableNameChecker” rule in CFLint complains, telling me that scope names should never be written in capital letters. My reasoning for doing that nevertheless is simple: the names of these scopes have been reserved and fixed by Adobe, so you cannot use them for anything else. So going “allcaps” on them neatly sets them apart from variable and function names. With the current situation I have to disable the rule completely.
I would like to see this checker adapted so that I can specify whether I want scope names “allcaps” or “nocaps” (or even “camelCase” of “PascalCase”) in the CFLint configuration file. That way I could easily check whether I applied my own rule correctly, by adapting the config as needed, regardless of the default set by the CFLint developers. The same approach could be worthwhile for variable names, component names, and function names, of course.
There are probably a few more situations like that in CFLint. If I find the time I may have a look at the Java code, to see how this might be implemented (don’t hold your breath, though).
You must be logged in to post a comment.