Complexity of reference (Elshof)

Title short form

Elshof

Categories

Efficiency, maintainability, reusability

Definition

Complexity of the data flow of a POU

The complexity of reference is calculated using the following formula:

<Number of variables used> / <Number of variable accesses>

Further information

Only variable accesses in the implementation part of the POU are taken into account.

Sample:

PROGRAM MAIN
VAR
    i, j  : INT;
    k     : INT := GVL.m;
    b, c  : BOOL;
    fb    : FB_Sample;
END_VAR
fb(paramA := b);   // +3 accesses (fb, paramA and b)
i := j;            // +2 accesses (i and j)
j := GVL.d;        // +2 accesses (j and GVL.d)

For the metric Complexity of reference (Elshof), MAIN:

Attention: