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.
These are the available model maintainability metrics, grouped by the sections they appear in the Model Maintainability Dashboard:
Component Structure and Interfaces
Metric | Description |
---|---|
Overall Design Cyclomatic Complexity | Number of possible execution paths through for a unit or component. |
Halstead Difficulty | Calculate the overall Halstead difficulty of MATLAB code, Stateflow charts, and Simulink design. |
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 the charts in 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 charts 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. |
Halstead Difficulty Breakdown
Metric | Description |
---|---|
Halstead Difficulty | Calculate the overall Halstead difficulty of MATLAB code, Stateflow charts, and Simulink design. |
Simulink Halstead Complexity | Count the operators and operands in Simulink models and calculate model volume and difficulty using the Halstead complexity metrics. |
Simulink Halstead Difficulty | Halstead difficulty of the Simulink models in your units and components. |
Simulink Halstead Difficulty Distribution | Distribution of Halstead difficulty across the Simulink models in your units and components. |
Stateflow Halstead Complexity | Count the operators and operands in Stateflow charts and calculate design volume and difficulty using the Halstead complexity metrics. |
Stateflow Halstead Difficulty | Halstead difficulty of the Stateflow charts in your units and components. |
Stateflow Halstead Difficulty Distribution | Distribution of Halstead difficulty across the Stateflow charts in your units and components. |
MATLAB Halstead Complexity | Count the operators and operands in MATLAB code and calculate code volume and difficulty using the Halstead complexity metrics. |
MATLAB Halstead Difficulty | Halstead difficulty of the MATLAB code in your units and components. |
MATLAB Halstead Difficulty Distribution | Distribution of Halstead difficulty across the MATLAB code in your units and components. |
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 the charts in a unit or component. |
Stateflow Transitions Distribution | Distribution of the number of Stateflow transitions in the charts in a unit or component. |
Overall States | Overall number of Stateflow states in a unit or component. |
Stateflow States | Number of Stateflow states in the charts in a unit or component. |
Stateflow States Distribution | Distribution of the number of Stateflow states in the charts in a unit or component. |
MATLAB Architecture
Metric | Description |
---|---|
Overall MATLAB Effective Lines of Code (eLOC) | Overall number of effective 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. |