matlabtest.codequalitydashboard.runTestsAndRefreshData - Run tests and refresh data in Code Quality Dashboard - MATLAB (original) (raw)

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.

Run the tests in the project, collect coverage for the tests, verify the requirements, and update the metrics in the dashboard.

matlabtest.codequalitydashboard.runTestsAndRefreshData

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"