Skip to main content
maintain

Keep your codebase in good shape

One way to move faster is to timely remove anything that slows you down in the long run. On top of that, removing unused code, files and localization helps you find unintentionally unused parts that are actually bugs.


Unused code detection

Clean up with little effort

As the amount of code and experimental features keeps growing, it's hard to keep up with things that are no longer used, but you end up maintaining them and tests for them anyway. Not with DCM.

Plus, removing code is awesome, isn't it?

From CLI Teams

Use the check-unused-code command to get a list of the unused declarations.

Unused code

Or in your IDE (Beta)

Additionally, you can enable the unused code IDE integration to get warnings about both existing and newly created publicly available unused code.

Unused code in IDE

With different modes Teams

When called from the CLI, this check excludes package's public API to avoid potential breaking changes. With monorepo mode, you can disable this behavior and analyze all your code.

There is another mode that includes class hierarchy into the unused code analysis. It's currently in Beta and is disabled by default as there can be false positives.

And output formats Teams

Use a CLI option to change the output format of the check-unused-code command to be one of the following: plain text, Code Climate, JSON, GitLab, Checkstyle.

For publicly available code

Unused code check works for public and private declarations, including classes, fields, methods, getters, setters, extensions, type aliases, mixins, and enums.


Unused files detection

Throw away entire files? Why not.

Refactoring may result in unused files or files that are only used in tests. Use unused files detection to find unused files as soon as they appear.

From CLI

Use the check-unused-files command to get a list of the unused files.

Unused files

Or in your IDE (Beta)

Additionally, you can enable the unused files IDE integration to get warnings about both existing and newly created unused files or files only referenced in tests.

Unused files in IDE

With automatic removal

When called from the CLI, you can pass an additional flag to automatically remove unused files.

And different output formats

Use a CLI option to change the output format of the check-unused-files command to be one of the following: plain text, Code Climate, JSON, GitLab, Checkstyle.


Unnecessary nullable parameters detectionTeams

Fewer conditions means fewer bugs Teams

A nullable parameter usually means additional checks and more complex code. But what if this parameter never gets a null value? Use this check to find such parameters and get simpler code.

Unnecessary nullable

With the monorepo mode support

This check excludes package's public API to avoid potential breaking changes. With monorepo mode, you can disable this behavior and analyze all your code.

And different output formats

Use a CLI option to change the output format of the check-unnecessary-nullable command to be one of the following: plain text, Code Climate, JSON, GitLab, Checkstyle.


Unused localization detection

Reduce your app bundle

Unused localization means more work for your localization team (or higher costs for a tool to store the localization strings) and is rarely thrown away by the compiler and ends up in your application bundle.

Unused localization

For different approaches

Whether you created Dart files manually or auto-generated them to load and use the localization string, this check will help you. And with a special CLI flag, you can configure which classes the check should look for.

With different output formats

Use a CLI option to change the output format of the check-unused-l10n command to be one of the following: plain text, Code Climate, JSON, GitLab, Checkstyle.


Misused dependencies detectionTeams

Timely remove unused external packages Teams

Unused dependencies can introduce version conflicts, which usually result in wasted hours of time. Additionally, dependencies can be accidentally installed into the wrong flavor (or require a flavors update after refactoring) which can later lead to compilation errors or larger bundles.

Misused dependencies

With configurable excludes

When it comes to dev dependencies, some package can be used transitively without a direct reference in code. To resolve such cases, you can configure this check to exclude a particular package.

And different output formats

Use a CLI option to change the output format of the check-dependencies command to be one of the following: plain text, Code Climate, JSON, GitLab, Checkstyle.


Duplicate code detectionTeams

Easily find unwanted duplications Teams

Unwanted duplication can not only lead to differences in behavior when only one of the duplicate declarations changes, but it also means writing and maintaining unnecessary additional tests. Use this check to always be aware of duplication in your codebase.

Code duplication

Resistant to insignificant changes

This check performs a structural comparison and is resistant to insignificant code changes. For example, it ignores changes to declaration names, local variable names, and parameter names.

With different modes

Since not all code duplication is bad, this check includes flexible configuration options to help filter out expected duplication. You can configure the number of statements after which a declaration is considered a duplicate, hide overridden declarations, or compare declarations only on per-package level.

And different output formats

Use a CLI option to change the output format of the check-code-duplication command to be one of the following: plain text, Code Climate, JSON, GitLab, Checkstyle.


DCM

Ready to fix your code?

Start today

Start Teams Trial