matlabtest.codequalitydashboard.getMetrics
Description
returns information about the current project and the code quality metrics from the Code Quality
Dashboard.info
= matlabtest.codequalitydashboard.getMetrics
Examples
This example shows how to update, get, and export metrics from the Code Quality Dashboard.
Open the ShortestPath
project.
openProject("MATLABShortestPath");
Open the Code Quality Dashboard.
codeQualityDashboard
Run the tests in the project, collect coverage for the tests, verify the requirements, and update the metrics in the dashboard.
matlabtest.codequalitydashboard.runTestsAndRefreshData
pathLength = 3
Get the metrics from the Code Quality Dashboard.
metrics = matlabtest.codequalitydashboard.getMetrics
metrics = struct with fields:
ProjectPath: "C:\Users\jdoe\MATLAB\MATLABShortestPath"
Metrics: [1×1 struct]
Export the metrics to a JSON file.
filePath = matlabtest.codequalitydashboard.exportMetrics
filePath = "C:\Users\jdoe\MATLAB\MATLABShortestPath\CodeQualityMetrics.json"
Output Arguments
Code quality metric information, returned as a structure with these fields:
Project root folder path, returned as a string.
Code Quality Dashboard metric results, returned as a structure with these fields:
Code Analyzer metric results, returned as a structure with these fields:
Date and time when the software collected the results, returned as a character vector.
Stale metric indicator, returned as a 1
or 0
of
data type logical
.
Test metric results, returned as a structure with these fields:
Date and time when the software collected the results, returned as a character vector.
Stale metric indicator, returned as a 1
or 0
of
data type logical
.
Test result metric data, returned as a structure with these fields:
Number of passed tests, returned as a double
.
Number of failed tests, returned as a double
.
Number of incomplete tests, returned as a double
.
Number of tests that have not run, returned as a double
.
Total number of tests, returned as a double
.
Code coverage metric results, returned as a structure with these fields:
Date and time when the software collected the results, returned as a character vector.
Stale metric indicator, returned as a 1
or 0
of
data type logical
.
Code coverage metric data, returned as a structure with these fields:
Function coverage percentage, returned as a double
.
Statement coverage percentage, returned as a double
.
Decision coverage percentage, returned as a double
.
Condition coverage percentage, returned as a double
.
MC/DC coverage percentage, returned as a double
.
Since R2024b
Generated code coverage metric results, returned as a structure with these fields:
Date and time when the software collected the results, returned as a character vector.
Stale metric indicator, returned as a 1
or 0
of
data type logical
.
Code coverage metric data, returned as a structure with these fields:
Function coverage percentage, returned as a double
.
Statement coverage percentage, returned as a double
.
Decision coverage percentage, returned as a double
.
Condition coverage percentage, returned as a double
.
MC/DC coverage percentage, returned as a double
.
Requirement verification metric results, returned as a structure with these fields:
Date and time when the software collected the results, returned as a character vector.
Stale metric indicator, returned as a 1
or 0
of
data type logical
.
Requirement verification metric data, returned as a structure with these fields:
Number of requirements that link to passed tests, returned
as a double
.
Number of requirements that link to failed tests, returned
as a double
.
Number of requirements that link to tests that have not run,
returned as a double
.
Number of requirements that do not link to tests, returned
as a double
.
Number of justified requirements links, returned as a double
.
Total number of requirements, returned as a double
.
Version History
Introduced in R2024aIf you have Embedded Coder®, the returned structure contains the GeneratedCodeCoverage
structure, which returns information about the generated code coverage metric
results.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)