Sonarqube + MATLAB project Code Quality Dashboard

31 ビュー (過去 30 日間)
Mariana
Mariana 2025 年 2 月 6 日
回答済み: Akanksha 2025 年 6 月 16 日
Is there a way to use the M-code metrics reports generated by MATLAB within Sonarqube project?

回答 (1 件)

Akanksha
Akanksha 2025 年 6 月 16 日
Yes, you can use MATLAB M-code metrics in a SonarQube project, but since SonarQube doesn’t directly support MATLAB, you’ll need to set up a custom integration. Here’s a simple breakdown of how to do it:
1. Generate Metrics in MATLAB
MATLAB has a Code Quality Dashboard that helps you gather useful metrics like Code analysis results, Test results, etc.
You can export these metrics to a .json file using this function:
filePath=matlabtest.codequalitydashboard.exportMetrics;
Before exporting, you can view and manage the metrics in the dashboard:
2. Integrate with SonarQube
Since SonarQube doesn’t natively understand MATLAB metrics, you’ll need to write a script or tool that:
  • Reads the exported JSON file
  • Converts the data into a format SonarQube understands (like the Generic Issue Data format)
  • Uploads it using the SonarQube Web API or during the analysis phase
This guide gives a good overview of MATLAB’s code quality tools:
3. Automate the Process
To make things smoother, you can plug this workflow into your CI/CD pipeline (like Jenkins or GitLab CI) so metrics are collected and reported automatically.
Hope this helps!

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by