---
name: "halstead"
section: "1"
platform: "linux"
package: "metrics"
version: "1.0-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/halstead"
---

# halstead(1)

program that estimates module complexity.

## NAME

halstead - program that estimates module complexity.

## SYNOPSIS

**halstead**  *files ...*\

## DESCRIPTION

**halstead** provides various indicators of the module's complexity. The module is examined to determine the following:

n1 == number of unique operators

n2 == number of unique operands

N1 == number of total operators

N2 == number of total operands

The program outputs these fields:

File Name

Program Length          (N  = N1 + N2)

Program Volume          (V  = N log\<base2\> (n1 + n2))

Program Level           (L  = (2/n1) \* (n2/N2))

Mental Discriminations  (E^ = V / L)

The program volume (aka \`\`Halstead Volume'') is probably most useful and seems to be reasonably well correlated with error counts for modules.

## SEE ALSO

[metrics(1)](/metrics/1.md), [mccabe(1)](/mccabe/1.md)

## AUTHOR

This manual page was written by  \<ioannis@debian.org\>, for the Debian GNU/Linux system (but may be used by others).
