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.

There are model maintainability metrics that can analyze:

Component Structure and Interfaces

MetricDescription
Overall Design Cyclomatic ComplexityNumber of possible execution paths through for a unit or component.
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 each layer of 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 Stateflow components 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.

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 each layer of a unit or component.
Stateflow Transitions DistributionDistribution of the number of Stateflow transitions in each layer of a unit or component.
Overall StatesOverall number of Stateflow states in a unit or component.
Stateflow StatesNumber of Stateflow states in each layer of a unit or component.
Stateflow States DistributionDistribution of the number of Stateflow states in each layer of a unit or component.

MATLAB Architecture

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

See Also

Related Topics