Main Content

Number of Local Static Variables

Total number of local static variables in function

Description

Note

Use Bug Finder instead of Code Prover for computing code metrics. Support for computing code metrics in Code Prover will be removed in a future release. See Version History.

This metric provides the number of local static variables in a function.

Examples

expand all

void func(void) {
  static int var_1 = 0;
  int var_2;
}

In this example, the number of static variables in func is 1. For examples of different types of variables, see Number of Local Non-Static Variables.

Metric Information

Group: Function
Acronym: LOCAL_STATIC_VARS
HIS Metric: No

Version History

Introduced in R2017a

expand all