Main Content

-start-level-from-one

Start counting the call level or nesting level from one.

Syntax

-start-level-from-one

Description

-start-level-from-one specifies that when calculating the metric Number of Call Levels, Polyspace® must start counting call levels from one.

By default, Polyspace starts counting call levels from zero. If you want to start counting call level or nesting depth from one, use this option. For instance, the European Cooperation for Space Standardization (ECSS) specifies that nesting level starts at one. To comply with such requirements, specify the option -start-level-from-one when you calculate code metrics.

Examples

If you want to start counting call level or nesting depth from one instead of zero, use this option. Consider this code:

int foo(void) {
    int j, i = 0;

    while (i++ < 10) {
        while (j < 10) {
            j++;
        }
    }

    return 0;
} 
By default, Polyspace calculates the metric Number of Call Levels for this code as 2. If you specify the option -start-level-from-one, Polyspace starts counting call levels from 1 and the metric becomes 3

Dependencies

Before using this option, activate the code metrics by using the option Calculate code metrics (-code-metrics). If you do not activate the code metric, specifying this option has no impact on the analysis.