Generate Static Code Metrics
The code generator performs Static Code Metrics Analysis (Embedded Coder) of the generated C or C++ code and provides these metrics in the Static Code Metrics Report section of the HTML Code Generation Report. When you place your cursor over a function or a variable in the generated code, you can also see metrics.
For more information about static code metrics, see Static Code Metrics (Embedded Coder).
To generate static code metrics for an AUTOSAR model
Open the Configuration Parameters dialog box of the model.
On the Code Generation > Report pane, select the Generate static code metrics (Embedded Coder) check box.
If the model includes referenced models, select the Generate static code metrics check box in each referenced model's configuration set. Otherwise you cannot view a separate static code metrics for a referenced model.
Build the model and generate the HTML code generation report.
Open the HTML code generation report and select Static Code Metrics Report from the Contents section on the left navigation pane.
Alternatively, after you generate code for the model, generate only the static code
metrics report by using the function coder.report.generateCodeMetrics
(Embedded Coder).
To generate the static code metrics report for an AUTOSAR adaptive model with Toolchain (Simulink Coder) set to
AUTOSAR Adaptive | CMake
.
Set the Code Generation > Build process > Build configuration to
Specify
.Specify locations of AUTOSAR header files in the Include Directories under Toolchain details.
See Also
coder.report.generateCodeMetrics
(Embedded Coder) | Toolchain (Simulink Coder)
Related Topics
- Static Code Metrics (Embedded Coder)