Model Maintainability Metrics
The Model Maintainability Dashboard is a model design dashboard that collects metric data from the model design artifacts in a project, such as MATLAB® code, Simulink® models, and Stateflow® charts. Use the metric data to assess the maintainability and complexity of the units and components in your design across the model development lifecycle. Each metric in the dashboard measures a different aspect of the maintainability of your design. Use the widgets in the Model Maintainability Dashboard to see high-level metric results and to gauge the complexity of the units and components in your design.
Alternatively, you can use the API functions to collect metric results programmatically.
When using the API, use the metric identifiers (metric IDs) to refer to each metric. You can
use the function getAvailableMetricIds
to return a list of
available metric identifiers.
There are model maintainability metrics that can analyze:
Component Structure and Interfaces
Metric | Description |
---|---|
Overall Design Cyclomatic Complexity | Number of possible execution paths through for a unit or component. |
Layer Depth | How many layers deep a model component is in the model hierarchy. |
Maximum Layer Depth | Maximum number of layers in the model hierarchy of a unit or component. |
Layer Breadth | Number of child model components that each artifact contains. |
Maximum Layer Breadth | Maximum number of child model components that a single model layer in the unit or component contains. |
Input and Output Component Interface Ports | Number of input ports and output ports to the component interface. |
Input and Output Component Interface Signals | Number of input signals and output signals that connect to the component interface. |
Decisions and Design Cyclomatic Complexity
Metric | Description |
---|---|
Simulink Decision Count | Number of Simulink decisions in each layer of your unit or component. |
Simulink Decision Distribution | Distribution of the Simulink decisions in your unit or component. |
Simulink Design Cyclomatic Complexity | Number of possible execution paths through the Simulink model components in your unit or component. |
Stateflow Decision Count | Number of Stateflow decisions in each layer of your unit or component. |
Stateflow Decision Distribution | Distribution of the Stateflow decisions in your unit or component. |
Stateflow Design Cyclomatic Complexity | Number of possible execution paths through the Stateflow components in your unit or component. |
MATLAB Decision Count | Number of decisions in the MATLAB code associated with your unit or component. |
MATLAB Decision Distribution | Distribution of the MATLAB decisions in your unit or component. |
MATLAB Design Cyclomatic Complexity | Number of possible execution paths through the MATLAB code in your unit or component. |
Simulink Architecture
Metric | Description |
---|---|
Overall Blocks | Overall number of blocks in a unit or component. |
Simulink Blocks | Number of Simulink blocks in each layer of a unit or component. |
Simulink Blocks Distribution | Distribution of the number of Simulink blocks in each layer of a unit or component. |
Overall Signal Lines | Overall number of Simulink signal lines in a unit or component. |
Simulink Signal Lines | Number of Simulink signal lines in each layer of a unit or component. |
Simulink Signal Lines Distribution | Distribution of the number of Simulink signal lines in a unit or component. |
Overall Goto Blocks | Overall number of Goto blocks in a unit or component. |
Simulink Goto Blocks | Number of Goto blocks in each layer of a unit or component. |
Simulink Goto Blocks Distribution | Distribution of the number of Goto blocks in each layer of a unit or component. |
Stateflow Architecture
Metric | Description |
---|---|
Overall Transitions | Overall number of Stateflow transitions in a unit or component. |
Stateflow Transitions | Number of Stateflow transitions in each layer of a unit or component. |
Stateflow Transitions Distribution | Distribution of the number of Stateflow transitions in each layer of a unit or component. |
Overall States | Overall number of Stateflow states in a unit or component. |
Stateflow States | Number of Stateflow states in each layer of a unit or component. |
Stateflow States Distribution | Distribution of the number of Stateflow states in each layer of a unit or component. |
MATLAB Architecture
Metric | Description |
---|---|
Overall MATLAB Executable Lines of Code (eLOC) | Overall number of executable lines of MATLAB code in a unit or component. |
MATLAB Effective Lines of Code (eLOC) | Number of effective lines of MATLAB code. |
MATLAB Effective Lines of Code (eLOC) Distribution | Distribution of the number of effective lines of MATLAB code. |