Quick Start
This quick start will help you set up DCM quickly but doesn't cover all edge cases. We recommend following the full Getting Started steps to get more comprehensive information and details but if you need to speed up, here are the steps.
Step 1: Installation​
- Windows
- Linux
- macOS
Use Chocolatey to install DCM:
choco install dcm
For a specific version:
choco install dcm --version 1.15.0
Add the DCM repository and install:
sudo apt-get update
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
sudo apt-get update
sudo apt-get install dcm
Use Homebrew to install DCM:
brew tap CQLabs/dcm
brew install dcm
For a specific version:
brew install [email protected]
Step 2: Setup IDE​
Integrate DCM with your IDE to benefit from real-time code analysis and suggestions.
-
VS Code: Install the DCM extension from the marketplace: VS Code Extension
-
IntelliJ/Android Studio: Install the DCM plugin: IntelliJ Plugin
Step 3: License Activation​
Activate your DCM license to unlock full functionality:
dcm activate --license-key=YOUR_KEY
Step 4: Integration​
Enable recommended
rules in your analysis_options.yaml
:
dart_code_metrics:
extends:
- recommended
Step 5 (Optional): Migration​
If migrating from the plugin version, follow these steps:
-
Remove DCM as a package dependency.
-
Update the
analysis_options.yaml
file to remove DCM from the plugins section. -
Use the new command:
dcm analyze lib
-
Update CI/CD configurations to use the
dcm
executable.
Step 6: Learn More​
Explore further resources to fully utilize DCM: