CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

CFScript function length check is off by one

Open adamcameron opened this issue 3 years ago • 1 comments

v1.5 (via commandbox-cflint, v2.3)

Here's a gist with a CFScript function that is 100 lines long.

I am using this .cflintrc file, in the same directory:

{
    "rule": [ ],
    "excludes": [ ],
    "includes": [
		{"code": "EXCESSIVE_FUNCTION_LENGTH"}
	],
    "inheritParent": false,
    "parameters": {}
}

Here's the output of my test run:

root@3200b7c82b5e:/app# wc -l test/cflint/script.cfm
102 test/cflint/script.cfm
root@3200b7c82b5e:/app# box cflint test/cflint/script.cfm

        Total Files:    1
        Total Lines:    103
        WARNINGS:       1

        /app/test/cflint/script.cfm   1
                WARNING: EXCESSIVE_FUNCTION_LENGTH, Function scriptOnlyFunction100Lines is 101 lines. Should be fewer than 100 lines. [2,1]
root@3200b7c82b5e:/app#

adamcameron avatar Jun 30 '21 09:06 adamcameron

I can confirm this behavior.

bhartsfield avatar Jun 30 '21 11:06 bhartsfield