Integrating DCM Dashboards
This guide walks you through the complete process of integrating your project with DCM Dashboards from creating a project and choosing an upload strategy, to uploading your analysis results and generating reports.
1. Create Your First Project​
A project in the Dashboards is expected to represent a single entrypoint from which the tool is being run. For example, if you run the tool from the root of your repository/package, there needs to be only one project. But if you have multiple packages in your repository and run DCM in each package separately, then you need to create a project for each package.
To create a new project:
- Click the
+ Add project
button. - Enter a project name.
- Click Add project.
The new project will appear immediately in the list.
Uploading only from a single branch is supported right now, but if you want to upload from multiple branches (e.g. main
and feature-branch
), consider creating several project in the Dashboards each representing a branch in your repository.
2. Choose Your Uploading Strategy​
DCM gives you the flexibility to upload analysis results either from your local machine or from your CI/CD pipelines, depending on your workflow and deployment strategy.
If you are already running dcm commands on our CI/CD (e.g. dcm analyze lib
or dcm check-unused-code lib
), uploading your project data is not a replacement for those checks and should be set up independently.
Branch​
Initially you need to decide on which branch should be deploy to a project that you create. For example, you might have staging
project for feature-branch
and main
branch goes to your production projects.
Local​
You can run DCM analysis and upload results directly from your local machine. DCM supports running checks and uploading in a single command, so you don’t need to split the workflow:
dcm run lib --all --upload --with-details --project=PROJECT_KEY --email=LICENSE_EMAIL
You can also upload data from a branch as well. We do recommend you to create a project for a branch or staging / testing environment and separate it from your production environment or main
branch.
CI/CD (Recommended)​
We recommend adding DCM to your CI/CD pipeline. Typically, it can be triggered on merges to your main
branch. This keeps your Dashboards up-to-date with every meaningful change.
Here is an example of Github Action:
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
...
- name: Run DCM and Upload
run: |
dcm run lib \
--all \
--upload \
--with-details \
--project=${{ secrets.DCM_PROJECT_KEY }} \
--email=${{ secrets.DCM_LICENSE_EMAIL }} \
--ci-key=${{ secrets.DCM_CI_KEY }}
You’re free to upload at any time, daily, weekly, or even multiple times a day. Just keep in mind, only the latest upload per day is kept. If you upload more than once in a day, the newest upload will overwrite the previous one to ensure the dashboard always reflects the most recent data.
3. Upload Your Metadata​
DCM lets you upload your analysis results whether you want a lightweight summary or a full report with all details.
Here’s a typical command that runs a full analysis and uploads everything:
dcm run lib --all --upload --with-details --project=PROJECT_KEY --email=LICENSE_EMAIL
Each flag is responsible to handle a task:
--all
- Runs all available code quality checks.--upload
- to indicate that the results of the command should be uploaded--project
- to pass the unique key of a project in your DCM Dashboards--with-details
- to switch to a more detailed mode. By default the command will only upload a summary and configuration. With this flag the command will also upload a list of issues and metrics.
DCM also provides additional flags to control how uploads behave:
--preview-upload
: Performs a dry run and shows what would be uploaded without sending any data. Great for validation before committing changes.
dcm run lib --all --upload --with-details --project=PROJECT_KEY --email=LICENSE_EMAIL --preview-upload
and here is the result in your console:
~/.../example_app on main ✗ > dcm run lib --all --upload --with-details --project=PROJECT_KEY --email=LICENSE_EMAIL --preview-upload
{
"project": "<hidden>",
"email": "<hidden>",
"date": "2025-04-25T13:13:15.516343",
"dateOverride": null,
"version": "1.28.0",
"issues": {
"96f9112a84d1f0e410fcebd0885bc17f": {
"issues": [
{
"id": "duplication-issue",
"message": "This method has 1 duplicate declaration",
"line": 168,
"effort": 20
},
],
...
}
--upload-date="YYYY-MM-DD"
: Lets you override the upload date.
dcm run lib --all --upload --upload-date="2025-04-15"
Project Key​
You’ll find the Project Key at the top of the selected project page in your DCM Dashboards.
Copy and use it in all your --project
flags to ensure the data is correctly linked.
Available Code Quality Checks​
Instead of --all
, you can target specific types of analysis based on your goals:
dcm run lib \
--analyze \
--metrics \
--code-duplication \
--upload \
--with-details \
--project=PROJECT_KEY \
--email=LICENSE_EMAIL
If you are passing --analyze
or --metrics
, don't forget to enable DCM lint rules or metrics in your package's analysis_options.yaml
.
Available check flags include:
--all Run all dcm commands.
--analyze Run dcm analyze.
--metrics Run dcm calculate-metrics.
--analyze-assets Run dcm analyze-assets.
--code-duplication Run dcm check-code-duplication.
--unused-code Run dcm check-unused-code.
--unused-files Run dcm check-unused-files.
--dependencies Run dcm check-dependencies.
--unused-l10n Run dcm check-unused-l10n.
Note that the other flags are not available for Dashboards including:
--parameters Run dcm check-parameters.
--analyze-widgets Run dcm analyze-widgets.
--exports-completeness Run dcm check-exports-completeness.
Keep in mind that every time you upload data with specific flag, it will override the entire previous dashboard data to ensure the data is always up-to-date.
4. View the Results​
After you uploaded the data successfully, your data is available immediately on the dashboard.
5. (Optional) Generate a Report​
If you need to print or generate a report for stakeholders and share it with your customers,managers or teammates, use the browser ctrl+P
/cmd+P
menu and save the page as PDF.