DCM Overview
DCM (formerly Dart Code Metrics) is a comprehensive toolkit designed to enhance the quality and maintainability of your Dart and Flutter code. By identifying and resolving a wide range of issues—from potential runtime bugs and performance issues to styling inconsistencies—DCM ensures that your code adheres to the highest standards.
Equipped with over 300 customizable rules, DCM provides robust validation against diverse coding expectations. These rules can be configured to meet the specific needs of your team, offering flexibility and precision in maintaining code quality.
In addition to rule-based validation, DCM offers in-depth code analytics through the calculation of various metrics. These metrics help you understand the complexity and health of your codebase, enabling you to set and monitor thresholds for continuous improvement.
Features Overview
Here are some key features:
-
Comprehensive Rule Set: With over 300 built-in rules (including rules for packages like "provider", "bloc", "riverpod" and more), DCM validates your code against a wide range of expectations. These rules are customizable, allowing you to configure them to fit your specific team needs.
-
Code Metrics and Analytics: DCM collects analytical data on your code, such as complexity metrics and Flutter widget quality metrics. These insights help you maintain and improve code quality over time by setting thresholds and monitoring metrics.
-
Quick Fixes and Auto-fixes: DCM provides quick fixes for many issues directly within your IDE, reducing the time spent on manual corrections. Auto-fix capabilities further streamline the process of maintaining code quality.
-
Duplicate Widgets Analysis: DCM analyzes your Flutter widgets for duplication and provides a list of similar widgets (even for partially matching subtrees).
-
Refactoring Commands: DCM provides a wide range of refactoring commands (such as unused code detection, duplicate code detection, unused localization detection, misused dependencies detection and more). These commands help you manage your technical debt and avoid tricky bugs.
-
Baseline and Preview: To simplify integration into existing projects, DCM provides additional features to quickly preview all current issue violations and to show warnings only for newly added code.
-
IDE Integration: Seamless integration with popular IDEs like VS Code, Android Studio, and IntelliJ IDEA ensures that DCM is easily accessible and fits naturally into your existing development workflow.
-
CI/CD Integration: DCM supports integration with CI/CD pipelines (GitHub, GitLab, Bitbucket, Azure and more), enabling automated code quality checks and metrics analysis as part of your build process. This ensures consistent code quality across your team.
-
Fully Local Analysis: Your code never leaves your device/environment as all analysis is performed locally without any remote server.
-
Quick and Simple Installation: It takes no more than 10 minutes to install DCM and start getting valuable results from lints and commands.
To learn more about the specific features and capabilities of DCM, visit the Features page.