Main Content

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

MetricDescription
Overall Design Cyclomatic ComplexityNumber of possible execution paths through for a unit or component.
Halstead DifficultyCalculate the overall Halstead difficulty of MATLAB code, Stateflow charts, and Simulink design.
Layer DepthHow many layers deep a model component is in the model hierarchy.
Maximum Layer DepthMaximum number of layers in the model hierarchy of a unit or component.
Layer BreadthNumber of child model components that each artifact contains.
Maximum Layer BreadthMaximum number of child model components that a single model layer in the unit or component contains.
Input and Output Component Interface PortsNumber of input ports and output ports to the component interface.
Input and Output Component Interface SignalsNumber of input signals and output signals that connect to the component interface.

Decisions and Design Cyclomatic Complexity

MetricDescription
Simulink Decision CountNumber of Simulink decisions in each layer of your unit or component.
Simulink Decision DistributionDistribution of the Simulink decisions in your unit or component.
Simulink Design Cyclomatic ComplexityNumber of possible execution paths through the Simulink model components in your unit or component.
Stateflow Decision CountNumber of Stateflow decisions in the charts in your unit or component.
Stateflow Decision DistributionDistribution of the Stateflow decisions in your unit or component.
Stateflow Design Cyclomatic ComplexityNumber of possible execution paths through the charts in your unit or component.
MATLAB Decision CountNumber of decisions in the MATLAB code associated with your unit or component.
MATLAB Decision DistributionDistribution of the MATLAB decisions in your unit or component.
MATLAB Design Cyclomatic ComplexityNumber of possible execution paths through the MATLAB code in your unit or component.

Halstead Difficulty Breakdown

MetricDescription
Halstead DifficultyCalculate the overall Halstead difficulty of MATLAB code, Stateflow charts, and Simulink design.
Simulink Halstead ComplexityCount the operators and operands in Simulink models and calculate model volume and difficulty using the Halstead complexity metrics.
Simulink Halstead DifficultyHalstead difficulty of the Simulink models in your units and components.
Simulink Halstead Difficulty DistributionDistribution of Halstead difficulty across the Simulink models in your units and components.
Stateflow Halstead ComplexityCount the operators and operands in Stateflow charts and calculate design volume and difficulty using the Halstead complexity metrics.
Stateflow Halstead DifficultyHalstead difficulty of the Stateflow charts in your units and components.
Stateflow Halstead Difficulty DistributionDistribution of Halstead difficulty across the Stateflow charts in your units and components.
MATLAB Halstead ComplexityCount the operators and operands in MATLAB code and calculate code volume and difficulty using the Halstead complexity metrics.
MATLAB Halstead DifficultyHalstead difficulty of the MATLAB code in your units and components.
MATLAB Halstead Difficulty DistributionDistribution of Halstead difficulty across the MATLAB code in your units and components.

Simulink Architecture

MetricDescription
Overall BlocksOverall number of blocks in a unit or component.
Simulink BlocksNumber of Simulink blocks in each layer of a unit or component.
Simulink Blocks DistributionDistribution of the number of Simulink blocks in each layer of a unit or component.
Overall Signal LinesOverall number of Simulink signal lines in a unit or component.
Simulink Signal LinesNumber of Simulink signal lines in each layer of a unit or component.
Simulink Signal Lines DistributionDistribution of the number of Simulink signal lines in a unit or component.
Overall Goto BlocksOverall number of Goto blocks in a unit or component.
Simulink Goto BlocksNumber of Goto blocks in each layer of a unit or component.
Simulink Goto Blocks DistributionDistribution of the number of Goto blocks in each layer of a unit or component.

Stateflow Architecture

MetricDescription
Overall TransitionsOverall number of Stateflow transitions in a unit or component.
Stateflow TransitionsNumber of Stateflow transitions in the charts in a unit or component.
Stateflow Transitions DistributionDistribution of the number of Stateflow transitions in the charts in a unit or component.
Overall StatesOverall number of Stateflow states in a unit or component.
Stateflow StatesNumber of Stateflow states in the charts in a unit or component.
Stateflow States DistributionDistribution of the number of Stateflow states in the charts in a unit or component.

MATLAB Architecture

MetricDescription
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) DistributionDistribution of the number of effective lines of MATLAB code.

See Also

Related Topics