volume property

double get volume

Halstead volume: V = N × log₂(n)

Implementation

double get volume {
  if (vocabulary <= 0) return 0;
  return length * (math.log(vocabulary) / math.log(2));
}