Main Content

Code Metrics

Description and examples of code metrics

You can calculate project, file and function level code metrics using Bug Finder. Use the Calculate code metrics (-code-metrics) analysis option to calculate the code metrics. For a list of supported code metrics in Bug Finder, See Code Metrics.

Calculating stack usage metrics is supported in Code Prover. Use the option Calculate stack usage (-stack-usage) to calculate the stack usages of your code.

Note

Code Prover will not support calculating code metrics other than stack usage metrics starting from a future release. Migrate to Bug Finder for calculating code metrics.

Polyspace Results

expand all

Minimum Stack UsageTotal size of local variables in function taking nested scopes into account plus maximum stack usage from callees
Maximum Stack UsageTotal size of local variables in function plus maximum stack usage from callees
Program Maximum Stack UsageMaximum stack usage in the analyzed program
Program Minimum Stack UsageMaximum stack usage in the analyzed program taking nested scopes into account
Higher Estimate of Size of Local VariablesTotal size of all local variables in function
Lower Estimate of Size of Local VariablesTotal size of local variables in function taking nested scopes into account

Topics