MATLAB Code Analyzer Findings
R2026bMetric ID
modeldesign.ComplianceAnalysis[slcomp.MATLABCodeAnalyzerFindings]
Description
This metric returns the number of MATLAB® Code Analyzer findings for each unit in your project, grouped by severity. Use this metric to identify units that have code quality issues and to prioritize fixes 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 metric results for Units in the project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.
Collection
To collect data for this metric, execute the metric engine with the metric ID.
metric_engine = metric.Engine;
results = execute(metric_engine,"modeldesign.ComplianceAnalysis[slcomp.MATLABCodeAnalyzerFindings]")View the metric result values for a specific unit.
results(1).Value results(1).ScopeAlias
To collect both the summary and detailed findings metrics in a single call, use empty
bracket syntax. Use the MetricID property to distinguish between
results.
results = execute(metric_engine,"modeldesign.ComplianceAnalysis[]")Results
The metric returns an array of objects, one for each unit in the project.
Use the metric.ResultValue property of the metric result object to view the metric
result values. Use the ScopeId and ScopeAlias
properties to identify which unit the result belongs to.
The ScopeAlias property returns the name of the unit.
The Value property returns a structure with these
fields:
Errors— Number of error-level findingsWarnings— Number of warning-level findingsInfo— Number of informational findingsTotal— Total number of Code Analyzer findings, equal to the sum ofErrors,Warnings, andInfo
See Also
Model Design Metrics | MATLAB Code Analyzer Findings per Design Layer | MATLAB Code Analyzer Findings Details