Skip to content
Fallow home
All docs pages

Docs home

Long file

What a long-file finding of fallow health means, why it matters and how to fix it.

What it reports

File has more lines than the file-length threshold.

Health explains how fallow finds it.

Why it matters

A long file is slow to review and to search. More changes touch the same file, so merge conflicts happen more often.

Example

A module grew to 900 physical lines while health.maxFileLines is 500. Blank lines and comment lines count; a final newline does not add a line.

Fix

Move cohesive groups of exports into their own modules, and remove unused code. In fallow audit, a long file that did not grow stays inherited, so you can enable the threshold on an existing project and stop further growth. To report these findings without a failed run, set the complexity-file-lines rule to warn. To raise the ceiling for generated files, use thresholdOverrides[].maxFileLines.

Facts

FactValue
Issue typelong-file
Rule id in SARIF outputfallow/long-file
Commandfallow health
Default severityerror
Config key in rulescomplexity-file-lines
Filter option--complexity
Suppression comment// fallow-ignore-file complexity
Fixable with fallow fixNo
Opt-inNo

When to keep the code

  • Generated files: set maxFileLines to 0 for them in a health.thresholdOverrides entry with files.
  • To hide one file, put // fallow-ignore-file complexity at the top. This comment also hides the function findings of the file.