Source file should not be too long

# L006

# Source file should not be too long

Description:

The source file should not exceed a reasonable length.

Long source files can indicate an opportunity for refactoring.

Recognized parameters:

Name | Default | Description
--- | --- | ---
`max-file-length` | `2000` | Maximum number of lines in a file.

Compliance: Inspirel

Show source code for this rule

Hide source code

    # Source file should not be too long

    set maxLines [getParameter "max-file-length" 2000]

    foreach f [getSourceFileNames] {
        set length [getLineCount $f]
        if {$length > $maxLines} {
            report $f $length "source file is too long"
        }
    }

Rule index