MATLAB Code Analyzer Findings per Design Layer
R2026bMetric ID
mldesignlayer.MATLABCodeAnalyzerFindings
Description
This metric returns the number of issues found by the MATLAB® Code Analyzer for each MATLAB function or method in your project. Use this information to identify MATLAB code that might require fixes, prioritizing by issue severity.
For more information about the MATLAB Code Analyzer, see Check Code for Errors and Warnings Using the Code Analyzer.
Supported Artifacts
This metric collects results for MATLAB design layers in the project, as shown by the metric ID prefix
mldesignlayer. A MATLAB design layer is an element, such as a MATLAB function, method, or MATLAB Function block in a Simulink® model, that you implement using MATLAB code. The metric returns one result per design layer.
Collection
To collect data for this metric, execute the metric engine with the metric ID.
metric_engine = metric.Engine;
results = execute(metric_engine,"mldesignlayer.MATLABCodeAnalyzerFindings")View the metric result values and scope for a specific design layer.
results(1).Value results(1).ScopeAlias
Results
The metric returns an array of objects, one for each MATLAB design layer in the project. Use the metric.ResultValue property of the
metric result object to view the metric result values. Use the Artifacts,
ScopeId, and ScopeAlias properties to identify
which MATLAB design layer the metric result belongs to.
The Value property returns a structure with these
fields:
Errors— Number of syntax errors or other significant issuesSevereErrors— Number of severe errors, such as syntax-level problems that prevent MATLAB from parsing the element correctly. This number is a subset ofErrors.Warnings— Number of warning messagesInfo— Number of informational messagesOverall— Total number of Code Analyzer messages, equal to the sum ofErrors,Warnings, andInfo
The ScopeAlias property returns the name of the function or method
that the metric result applies to.
The Artifacts property returns a structure with these
fields:
UUID— Unique identifier for the MATLAB design layerName— Name of the function or methodParentUUID— Unique identifier for the parent file or modelParentName— Name of the file or model that contains the design layer
See Also
Model Design Metrics | Model Maintainability Metrics