Skip to main content

Configuring Metrics

Metrics are one of the core building blocks of DCM. Metrics help you understand the complexity of your code and identify areas that may be difficult to maintain or test.

All metrics are configurable.

Enabling a Metric

To enable a metric add its id to the metrics entry:

analysis_options.yaml
dart_code_metrics:
metrics:
cyclomatic-complexity: 20

Excluding Files for All Metrics

To exclude files from a metrics report, provide a list of glob patterns for ignored files:

analysis_options.yaml
dart_code_metrics:
exclude:
metrics:
- test/**
- lib/src/some_file.dart