Skip to main content

Module metric

Module metric 

Source
Expand description

File-level structural metrics.

An AST rule matches nodes; a metric rule measures a property of the whole file and fires once when the measured value exceeds a threshold. Metrics are computed directly on the parsed tree rather than through ast-grep, which has no notion of a whole-file match.

Enums§

Metric
A structural property measured over a whole file.

Functions§

compute
Measure metric over an already parsed file.
exceeds
A metric rule fires when the measured value is strictly above the threshold, so threshold: 500 does not flag a file of exactly 500 lines.