Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mehen.ophi.dev/llms.txt

Use this file to discover all available pages before exploring further.

NARGS counts the number of formal arguments declared by each function, method, or closure. mehen reports per-function values plus aggregate statistics (total, min, max, average) at the file level.

What mehen emits

KeyTypeDescription
nargsintTotal arguments across all functions and closures in the space.
nargs.averagefloatMean argument count per function.
nargs.functionsintTotal arguments declared by named functions.
nargs.functions_min / _max / _averageAggregates over named functions only.
nargs.closuresintTotal arguments declared by closures/lambdas.
nargs.closures_min / _max / _averageAggregates over closures only.
nargs.average_functionsfloatMean per named function.
nargs.average_closuresfloatMean per closure.
nargs.total_functionsintTotal of nargs.functions (alias).
nargs.total_closuresintTotal of nargs.closures (alias).

Why both functions and closures are reported

Closures are first-class values in TypeScript, Rust, Ruby, Kotlin, Python, etc. Mixing closure parameter counts with named-function parameter counts hides the long-tail of inline lambdas. mehen reports both buckets so you can see, for example, that a file’s named functions average 2 arguments while its callbacks average 4.

How to read it

Conventional ceilings (no universal authority — pick one for your repo):
Per-function nargsInterpretation
0–3Easy to call.
4–5Borderline; consider a parameter object.
6+Refactor candidate.
Robert C. Martin’s Clean Code recommends ≤ 3 as a soft cap; it’s a stylistic preference, not a hard rule.

References

  • Sonar: Metrics definitions.
  • Martin, R. C. (2008). Clean Code, ch. 3. (Soft cap of 3 for “ideal” function arity.)

See also

  • NOM — number of methods.
  • NEXITS — exit-point count.