# Static Code Metrics Report

The static code metrics report provides statistics of the generated code. Metrics are estimated from static analysis of the generated code using the C data types specified in the 'Device details' section of the Configuration Parameter > Hardware Implementation pane: char 8, short 16, int 32, long 32, float 32, double 64, pointer 64 bits. If your model contains a Variant block, the Static Code Metrics Report does not contain data for the inactive variant. Actual object code metrics might differ due to target specific compiler and platform settings. Consult the Code Generation Advisor for options to improve code efficiency.

### Table of Contents

1. File Information
2. Global Variables
3. Function Information

### 1. File Information [hide]

[-] Summary (excludes ert_main.c)
Number of .c files | : | 3 |
Number of .h files | : | 2 |
Lines of code | : | 379 |
Lines | : | 783 |
[-] File details
File Name | Lines of Code | Lines | Generated On
automats.c | 207 | 431 | 05/13/2021 9:48 PM
get.c | 58 | 75 | 05/04/2021 7:54 PM
rtwtypes.h | 44 | 103 | 05/13/2021 9:48 PM
set.c | 38 | 69 | 05/13/2021 9:20 PM
automats.h | 32 | 105 | 05/13/2021 9:48 PM

### 2. Global Variables [hide]

Global variables defined in the generated code.
Global Variable | Size (bytes) | Reads / Writes | Reads / Writes in a Function
[+] rtDW | 32 | 43 | 41
timer | 8 | 8 | 8
Memory2_PreviousInput | 8 | 5 | 5
Memory1_PreviousInput | 8 | 2 | 2
is_c2_automats | 1 | 17 | 16
is_Initialization | 1 | 5 | 4
is_Starting_state | 1 | 6 | 6
[+] rtM_ | 8 | 0* | 0*
errorStatus | 8 | 0 | 0
ug_rpm_sp | 2 | 1 | 1
Total | 42 | 44 |
* The global variable is not directly used in any function.

### 3. Function Information [hide]

View function metrics in a call tree format or table format. Accumulated stack numbers include the estimated stack size of the function plus the maximum of the accumulated stack size of the subroutines that the function calls.
View:Call Tree | Table
Function Name | Accumulated Stack Size (bytes) | Self Stack Size (bytes) | Lines of Code | Lines | Complexity
[+] automats_step | 37 | 29 | 157 | 336 | 30
[+] rt_roundd_snf | 8 | 8 | 13 | 17 | 4
fabs | Not available | - | - | - | -
floor | Not available | - | - | - | -
ceil | Not available | - | - | - | -
get_service | 0 | 0 | 1 | 4 | 1
v_set_faults_reset | 0 | 0 | 0 | 4 | 1
v_set_state | 0 | 0 | 0 | 4 | 1
v_set_dspace_reset | 0 | 0 | 0 | 4 | 1
v_set_stop_set | 0 | 0 | 0 | 4 | 1
get_faults | 0 | 0 | 1 | 4 | 1
v_set_commands_set | 0 | 0 | 0 | 4 | 1
[+] check_phases | 0 | 0 | 3 | 13 | 2
get_V1 | 0 | 0 | 1 | 4 | 1
get_V3 | 0 | 0 | 1 | 4 | 1
get_V2 | 0 | 0 | 1 | 4 | 1
v_set_state | 0 | 0 | 0 | 4 | 1
v_get_state | 0 | 0 | 1 | 4 | 1
get_start | 0 | 0 | 1 | 5 | 1
v_set_start_on | 0 | 0 | 0 | 4 | 1
get_stop | 0 | 0 | 1 | 4 | 1
get_started | 0 | 0 | 1 | 4 | 1
get_stopped | 0 | 0 | 1 | 4 | 1
get_rpm_req | 0 | 0 | 1 | 4 | 1
get_rpm | 0 | 0 | 1 | 4 | 1
fabs | Not available | - | - | - | -
set_rpm_sp | 0 | 0 | 1 | 4 | 1
automats_initialize | 0 | 0 | 2 | 6 | 1
__bswap_16 | 0 | 0 | 1 | 4 | 1
__bswap_32 | 0 | 0 | 1 | 4 | 1
__bswap_64 | 0 | 0 | 1 | 4 | 1
get_In1 | 0 | 0 | 1 | 4 | 1
get_rpm_sp | 0 | 0 | 1 | 4 | 1
set_duty | 0 | 0 | 0 | 4 | 1
v_set_duty | 0 | 0 | 0 | 4 | 1
v_set_start | 0 | 0 | 0 | 4 | 1
v_set_start_pos | 0 | 0 | 0 | 4 | 1
v_set_stop | 0 | 0 | 0 | 4 | 1
View: Call Tree | Table
Function Name | Called By (number of call sites) | Accumulated Stack Size (bytes) | Self Stack Size (bytes) | Lines of Code | Lines | Complexity
check_phases |
automats_step (3)
| 0 | 0 | 3 | 13 | 2
automats_initialize |  | 0 | 0 | 2 | 6 | 1
automats_step |  | 37 | 29 | 157 | 336 | 30
__bswap_16 |  | 0 | 0 | 1 | 4 | 1
__bswap_32 |  | 0 | 0 | 1 | 4 | 1
__bswap_64 |  | 0 | 0 | 1 | 4 | 1
ceil |
rt_roundd_snf
| Not available | - | - | - | -
fabs |
automats_step
rt_roundd_snf
| Not available | - | - | - | -
floor |
rt_roundd_snf
| Not available | - | - | - | -
get_In1 |  | 0 | 0 | 1 | 4 | 1
get_V1 |
check_phases
| 0 | 0 | 1 | 4 | 1
get_V2 |
check_phases
| 0 | 0 | 1 | 4 | 1
get_V3 |
check_phases
| 0 | 0 | 1 | 4 | 1
get_faults |
automats_step (6)
| 0 | 0 | 1 | 4 | 1
get_rpm |
automats_step
| 0 | 0 | 1 | 4 | 1
get_rpm_req |
automats_step
| 0 | 0 | 1 | 4 | 1
get_rpm_sp |  | 0 | 0 | 1 | 4 | 1
get_service |
automats_step (4)
| 0 | 0 | 1 | 4 | 1
get_start |
automats_step
| 0 | 0 | 1 | 5 | 1
get_started |
automats_step
| 0 | 0 | 1 | 4 | 1
get_stop |
automats_step
| 0 | 0 | 1 | 4 | 1
get_stopped |
automats_step
| 0 | 0 | 1 | 4 | 1
rt_roundd_snf |
automats_step
| 8 | 8 | 13 | 17 | 4
set_duty |  | 0 | 0 | 0 | 4 | 1
set_rpm_sp |
automats_step
| 0 | 0 | 1 | 4 | 1
v_get_state |
automats_step (3)
| 0 | 0 | 1 | 4 | 1
v_set_commands_set |
automats_step (4)
| 0 | 0 | 0 | 4 | 1
v_set_dspace_reset |
automats_step (7)
| 0 | 0 | 0 | 4 | 1
v_set_duty |  | 0 | 0 | 0 | 4 | 1
v_set_faults_reset |
automats_step (7)
| 0 | 0 | 0 | 4 | 1
v_set_start |  | 0 | 0 | 0 | 4 | 1
v_set_start_on |
automats_step (2)
| 0 | 0 | 0 | 4 | 1
v_set_start_pos |  | 0 | 0 | 0 | 4 | 1
v_set_state |
automats_step (15)
check_phases
| 0 | 0 | 0 | 4 | 1
v_set_stop |  | 0 | 0 | 0 | 4 | 1
v_set_stop_set |
automats_step (4)
| 0 | 0 | 0 | 4 | 1