Metrics from previous TwinCAT versions

Metrics from versions < TwinCAT 3.1.4026.14:

Column abbreviation in Standard Metrics view

Description

Prather

Complexity of nesting (Prather)

n1 (Halstead)

Halstead – number of different used operators (n1)

N1 (Halstead)

Halstead – number of operators (N1)

n2 (Halstead)

Halstead – number of different used operands (n2)

N2 (Halstead)

Halstead – number of operands (N2)

HL (Halstead)

Halstead – length (HL)

HV (Halstead)

Halstead – volume (HV)

D (Halstead)

Halstead – difficulty (D)

Complexity of nesting (Prather)

Nesting weight = statements * nesting depth

Complexity of nesting = nesting weight / number of statements

Nesting through IF/ELSEIF or CASE/ELSE statements, for example.

Halstead (n1, N1, n2, N2, HL, HV, D)

The following metrics are part of the "Halstead" range:

- Number of different used operators - Halstead (n1)

- Number of operators - Halstead (N1)

- Number of different used operands - Halstead (n2)

- Number of operands - Halstead (N2)

- Length - Halstead (HL)

- Volume - Halstead (HV)

- Difficulty - Halstead (D)

 

Background information:

 

For each program the following basic parameters are formed:

 

These parameters are used to calculate the Halstead length (HL) and Halstead volume (HV):

 

Various key figures are calculated from the basic parameters:

The key figures usually match the actual measured values very well. The disadvantage is that the method only applies to individual functions and only measures lexical/textual complexity.