# Call tree metrics

Call tree metrics measure the size and shape of the procedure call tree(s). Procedure call trees contain forward procedure calls, both explicit and implicit. Every potential procedure is taken into account, including procedures that might be executed via a polymorphic call or a raised event. Not all implicitly called procedures are included, though, if they cannot be detected reliably. An example is an event such as Form_Load or CheckBox_Click.

### DCALLT Depth of call tree

DCALLT is the maximum number of nested procedure calls from a procedure. Recursive calls are not counted.

#### Example

In the picture above you can see procedures sorted by their DCALLT, which you can see on the left side. DCALLT is zero for procedure D, because it is a leaf procedure. From procedure B the possible call paths are {D} and {C, D}, making DCALLT=2.

Recursive calls require special attention. DCALLT is also zero for H, even though H calls itself, because recursive calls are not counted. From procedure E the possible call paths are {H} and {F, G}, making the maximum path length 2. From procedure F the possible call path is {G, E, H}, making DCALLT=3. From procedure G the possible call paths are {E, H} and {E, F}, making DCALLT=2.

DCALLT measures the depth of the call tree, not the sheer size of it. A procedure with a low DCALLT can still call many procedures.

#### maxDCALLT Maximum depth of call tree

maxDCALLT is the maximum DCALLT in the project. It is the depth of the deepest call tree in the system.

Approximated DCALLT. Because the metric DCALLT can take an extensive amount of time to compute on a complex system, Project Analyzer may provide an approximated DCALLT (lower bound). Approximation only happens with systems having a recursive group of 50 or more procedures. In such a complex system, DCALLT only includes the first 3 levels of recursive calls. The approximated DCALLT values will be a minimum value. The call tree may be deeper. Approximation does not affect non-recursive call trees. Approximation may affect maxDCALLT as well.

### SCALLT Size of call tree

SCALLT is the number of distinct procedures in the call tree of a procedure, not counting the procedure itself. Each procedure is counted once regardless of how many times it exists in the call tree.

Example. In the picture above, SCALLT for procedure B is 2. It calls both C and D. As it happens, B calls D both directly and indirectly via C, but each procedure is counted just once. SCALLT for procedure A is 7. SCALLT for procedures D and H is 0, because they are leaf procedures. SCALLT is 3 for each procedure in the recursive group {E, F, G}.

SCALLT measures the overall size of the call tree. A procedure with a high SCALLT is likely to run a major feature in the program. A low SCALLT indicates a procedure that is relatively easy to reuse. When SCALLT=0, the procedure is an independent leaf procedure, a good candidate for reuse.

#### maxSCALLT Maximum size of call tree

maxSCALLT is the maximum SCALLT in the project. It is the size of the largest call tree in the system.

### LLOCt Lines in call tree

LLOCt = Logical lines of code that can potentially execute by a call to a procedure

LLOCt equals the total lines (LLOC, to be exact) in the call tree of a procedure, including the procedure itself. Each procedure is counted once regardless of how many times it exists in the call tree. Thus, LLOCt is counted in a similar way to SCALLT. The procedure itself is included in LLOCt, whereas it's excluded from SCALLT.

Example. In the picture above, LLOCt for procedure A is the total LLOC in the entire picture. LLOCt for B is the sum of LLOC for B, C and D.

LLOCt measures the complexity of a procedure call and it takes in account all the descendant procedures. You can use this metric to find procedure calls that lead to the execution of a large amount of code. These procedures are candidates for testing, as the complex logic behind them could contain faults or trigger run-time errors.

Because the metrics SCALLT, maxSCALLT and LLOCt may be very slow to compute, Project Analyzer does not provide them if the computation takes more than 30 seconds. In this case, you will not see these metrics. This happens rarely and only with very large call trees.

©Aivosto Oy - Project Analyzer Help Contents