cflint / CFLint

Static code analysis for CFML (a linter)
BSD 3-Clause "New" or "Revised" License
174 stars 84 forks source link

CFScript function length check is off by one #709

Open adamcameron opened 3 years ago

adamcameron commented 3 years ago

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#
bhartsfield commented 3 years ago

I can confirm this behavior.