Changelog
Sep 5, 2023
1.9.0: September Update
13 new rules, new presets and dedicated GitHub Action 🚀
- Rules update: 13 new rules 🔥
Common:- prefer-getter-over-method
- avoid-referencing-discarded-variables
- avoid-unconditional-break
- avoid-weak-cryptographic-algorithms
- avoid-identical-exception-handling-blocks
- avoid-recursive-calls
- move-variable-closer-to-its-usage
- avoid-missing-interpolation
- avoid-unnecessary-if
- avoid-passing-default-values
- avoid-passing-self-as-argument
- parameters-ordering
- avoid-async-callback-in-fake-async
Improved rules (false-positives and new cases):- prefer-correct-for-loop-increment
- prefer-correct-identifier-length
- avoid-unnecessary-reassignments
- prefer-moving-to-variable
- no-equal-nested-conditions
- prefer-declaring-const-constructor
- prefer-returning-conditional-expressions
- avoid-explicit-type-declaration
- avoid-shadowing
- avoid-unnecessary-negations
- unnecessary-trailing-comma
- prefer-trailing-comma
- prefer-correct-edge-insets-constructor
- map-keys-ordering
- no-equal-arguments
- avoid-passing-async-when-sync-expected
- avoid-recursive-widget-calls
- avoid-unnecessary-call
- avoid-unnecessary-futures
- avoid-unnecessary-type-assertions
- new config option (ignored-invocations) for avoid-nullable-interpolation
- new config option (ignored-instances) for avoid-unused-instances
- New recommended presets for rules and metrics 🚀: You can now enable two new presets "recommended" and "metrics_recommended" that should help you get started with DCM easier.
- DCM GitHub Action 🔥: Dedicated GitHub Action to setup and run DCM checks.
Aug 7, 2023
1.8.0: August Update
17 new rules (2 for the Patrol testing library 🔥), new command dcm init preview to simplify DCM integration into existing projects, support for dart_frog files for check-unused-code and check-unused-files, Gitlab reporter format for all existing commands and more 🚀
- Rules update: 17 new rules 🔥
Common:- avoid-map-keys-contains
- prefer-correct-json-casts
- avoid-async-call-in-sync-function
- avoid-duplicate-mixins
- avoid-nullable-interpolation
- enum-constants-ordering
- prefer-named-boolean-parameters
- avoid-unused-instances
- prefer-correct-for-loop-increment
- prefer-public-exception-classes
- match-class-name-pattern
- newline-before-case
- avoid-unnecessary-reassignment
- avoid-recursive-widget-calls
- prefer-text-rich
- prefer-custom-finder-over-find
- prefer-symbol-over-key
Improved rules (false-positives and new cases):- avoid-barrel-files
- arguments-ordering
- avoid-importing-entrypoint-exports
- format-comment
- avoid-unnecessary-futures
- avoid-redundant-async
- function-always-returns-null
- unnecessary-trailing-comma
- avoid-mutating-parameters
- prefer-first
- prefer-last
- avoid-unsafe-collection-methods
- prefer-explicit-parameter-names
- prefer-correct-error-name
- newline-before-return
- avoid-unnecessary-return
- member-ordering
- prefer-moving-to-variable
- list-all-equatable-fields
- avoid-long-functions
- avoid-explicit-type-declaration
- no-equal-then-else
- new config option (ignore-if-case) for prefer-early-return
- new config option (ignore-blocs) for dispose-fields
- new config option (ignore-mixins) for avoid-unrelated-type-assertions
- new config option (ignore-inline-functions) for no-equal-arguments
- new config option (ignore-inline-functions) for avoid-unused-parameters
- new config option (only-in-src) for avoid-importing-entrypoint-exports
- New quick fixes for existing rules 🚀:
- map-keys-ordering
- New command "dcm init preview" to show number of issues generated by each rule 🔥: Allows you to run all existing rules against your codebase and see which of the rules are producing issues and how many.
- Support for ignore commends for check-unused-code: Previously only top level ignore comments were supported by the check-unused-code command. With this release ignore comments can be applied to individual members as well.
- check-dependencies automatically marks some dependencies that are not directly used in code as used: If a package has a freezed_annotation or json_serializable dependencies then build_runner and freezed are automatically marked as used.
- Flutter plugins and dart_frog requests and middlewares are marked as used by default: Flutter web plugins and dart_frog can have special files that are not referenced by other files, but are still used. Both check-unused-files and check-unused-code now support these cases.
- Improved getters and fields usage detection in extensions for check-unused-l10n: Fields and getters now correctly marked as used if an extension on the localization class uses these fields or getters.
- Gitlab format support for all existing commands: All existing commands that designed to be used on CI now support --reporter=gitlab format.
- Unused code in the IDE (Beta): You can now enable the display of unused code in the IDE settings. Note, this feature supports only the monorepo mode for now and will be improved in the upcoming releases.
Jul 3, 2023
1.7.0: July Update
Improved overall experience with the configuration, 25 new rules, 24 improved existing rules and 17 new quick fixes 🚀🚀🚀.
- Rules update: 25 new rules 🔥
Common:- prefer-correct-future-return-type
- prefer-correct-stream-return-type
- avoid-nested-futures
- avoid-nested-streams-and-futures
- avoid-accessing-other-classes-private-members
- avoid-generics-shadowing
- avoid-uncaught-future-errors
- prefer-parentheses-with-if-null
- prefer-type-over-var
- avoid-keywords-in-wildcard-pattern
- avoid-misused-wildcard-pattern
- avoid-mutating-parameters
- avoid-unnecessary-call
- no-equal-nested-conditions
- avoid-negated-conditions
- prefer-correct-error-name
- map-keys-ordering
- avoid-unnecessary-futures
- avoid-shadowed-extension-methods
- avoid-barrel-files
- avoid-importing-entrypoint-exports
- avoid-missing-image-alt
- avoid-unnecessary-overrides-in-state
- prefer-dedicated-media-query-methods
- prefer-date-format
Improved rules (false-positives and new cases):- format-comment
- avoid-dynamic
- avoid-explicit-type-declaration
- banned-usage
- prefer-correct-identifier-length
- no-equal-conditions
- avoid-redundant-async
- avoid-redundant-async-on-load
- check-if-not-closed-after-async-gap
- use-setstate-synchronously
- unnecessary-trailing-comma
- prefer-returning-conditional-expressions
- avoid-unrelated-type-assertions
- avoid-unrelated-type-casts
- avoid-declaring-call-method
- avoid-missing-enum-constant-in-map
- prefer-declaring-const-constructors
- avoid-throw-objects-without-tostring
- no-boolean-literal-compare
- prefer-immediate-return
- avoid-unsafe-collection-methods
- prefer-immediate-return
- avoid-explicit-pattern-field-name
- avoid-missed-calls
- New quick fixes for existing rules 🔥:
- avoid-explicit-pattern-field-name
- avoid-missed-calls
- avoid-unused-generics
- avoid-redundant-pragma-inline
- prefer-visible-for-testing-on-members
- avoid-redundant-positional-field-name
- avoid-unnecessary-negations
- avoid-unsafe-collection-methods (only via IDE action)
- no-boolean-literal-compare
- prefer-conditional-expressions
- match-positional-field-names-on-assignment (only via IDE action)
- prefer-simpler-patterns-null-check
- prefer-wildcard-pattern
- no-equal-then-else
- format-comment
- prefer-last
- prefer-first
- Improved dcm fix for 4 existing rules: avoid-collapsible-if, avoid-redundant-else, arguments-ordering and member-ordering quick fixes are now calculated lazily, improving the overall performance for these rules to compute.
- Support for Dart SDK installed via brew: Now, if the SDK is installed via brew is is correctly picked up by the CLI and IDE plugins. No need to pass it as the CLI option!
- Support for ci_key and email env variables on CI/CD: If you run DCM on CI, you can now set DCM_CI_KEY and DCM_EMAIL env variables instead of passing ci_key and email via CLI options.
- Gradual reanalysis after the analysis_options file is changed: Previously any change to the analysis_options resulted in the whole project reanalysis. Now, the package gets reanalyzed only if the parts of the config that can affect the analysis change.
- Warning if a preset is not found: If a preset cannot be resolved a warning will be shown.
- Proper reanalysis for dependant packages: Changes to analysis_options result in all dependent package reanalysis.
Jun 6, 2023
1.6.0: June Update
Improved baseline, customizable formatter, new rules and more! 🔥
- Unification of the Individuals and Teams version codebase: Individuals version is now shares the codebase with the Teams version with some features limitation.
- Customizable formatter with project-wide config 🔥: Allows you to enable a configurable formatter that works from both the IDE and the CLI.
- Rules update: 5 new rules 🔥
Common:- avoid-unnecessary-return
- avoid-future-tostring
- avoid-unassigned-late-fields-keyword
- prefer-test-matchers
- prefer-number-format
Improved rules (false-positives and new cases):- avoid-shadowing
- member-ordering
- collection-methods-with-unrelated-types
- prefer-return-await
- prefer-multi-bloc-provider
- avoid-redundant-else
- avoid-self-assignment
- function-always-returns-null
- avoid-watch-outside-build
- avoid-unrelated-type-assertions
- dispose-fields
- list-all-equatable-fields
- arguments-ordering
- dcm fix support for fixing dependency issues: dcm fix now supports fixing the output from the dcm check-dependencies via the --type=dependencies option.
- Support for fvm global: fvm default sdk is now gets picked up automatically for the CLI and the IDE integrations.
- Improved baseline: Multiple fixes to how baseline works and a new code action to update the baseline for the selected file.
- VS Code extension updates:
- Supports formatting on save and via the IDE command.
- IntelliJ plugin update:
- A complete rewrite to eliminate all the performance issues.
- Supports formatting via the IDE command.
May 18, 2023
1.5.0: Dart 3 support
Dart 3.0 support for existing rules as well as 17 new rules for records and patterns 🚀.
- Rules update: 19 new rules (17 for Dart 3.0 🔥)
Common:- avoid-one-field-records
- move-records-to-typedefs
- avoid-bottom-type-in-records
- avoid-nested-records
- avoid-function-type-in-records
- avoid-positional-record-field-access
- avoid-mixing-named-and-positional-fields
- avoid-long-records
- match-positional-field-names-on-assignment
- avoid-redundant-positional-field-name
- avoid-nested-switch-expressions
- avoid-bottom-type-in-patterns
- avoid-explicit-pattern-field-name
- prefer-wildcard-pattern
- no-equal-switch-expression-cases
- prefer-simpler-patterns-null-check
- avoid-duplicate-patterns
- prefer-returning-conditional-expressions
- avoid-stateless-widget-initialized-fields
Dart 3.0 support for existing rules- avoid-banned-types
- avoid-returning-widgets
- avoid-similar-names
- prefer-correct-identifier-length
- avoid-collapsible-if
- avoid-dynamic
- avoid-explicit-type-declaration
- avoid-non-null-assertion
- avoid-shadowing
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unrelated-type-casts
- avoid-unsafe-collection-methods
- avoid-iterable-of
- prefer-trailing-comma
- unnecessary-trailing-comma
Improved rules (false-positives and new cases):- prefer-const-border-radius
- avoid-unused-generics
- function-always-returns-null
- avoid-border-all
- avoid-watch-outside-build
- prefer-enums-by-name
- avoid-equal-expressions
May 8, 2023
1.4.0: May Update
New command to find unused dependencies, 22 new rules (5 for Provider 🔥), wrap with custom widget assist and more!
- New command dcm check-dependencies 🔥: Allows you to checks missing, under-promoted, over-promoted, and unused dependencies. Works well with commented code and conditional imports!
- Rules update: 22 new rules 🔥
Common:- avoid-redundant-pragma-inline
- prefer-unwrapping-future-or
- avoid-unnecessary-negations
- avoid-banned-file-names
- avoid-unused-generics
- avoid-inverted-boolean-checks
- avoid-banned-types
- function-always-returns-null
- prefer-visible-for-testing-on-members
- avoid-throw-objects-without-tostring
- avoid-unsafe-collection-methods
- prefer-action-button-tooltip
- avoid-inherited-widget-in-initstate
- avoid-late-context
- avoid-state-constructors
- avoid-unnecessary-stateful-widgets
- check-is-not-closed-after-async-gap
- avoid-watch-outside-build
- avoid-read-inside-build
- dispose-providers
- prefer-multi-provider
- avoid-instantiating-in-value-provider
Improved rules (false-positives and new cases):- avoid-unnecessary-type-assertions
- missing-test-assertion
- no-equal-arguments
- prefer-widget-private-members
- avoid-unused-parameters
- avoid-redundant-async
- avoid-collection-methods-with-unrelated-types
- use-setstate-synchronously
- avoid-substring
- format-comment
- prefer-declaring-const-constructor
- Metrics update 🚀: 4 new metrics 🔥
Common:- Number of implemented interfaces (NOII)
- Number of added methods (NOAM)
- Number of overridden methods (NOOM)
- Number of external imports (NOEI)
- New "Wrap with..." assist: Allows you to add custom "Wrap with a widget" assists! 🚀
- VS Code extension updates:
- Supports new "Wrap with ..." assist.
- Supports locating Dart SDK via FVM.
- IntelliJ plugin update:
- Supports new "Wrap with ..." assist.
- Supports locating Dart SDK via FVM.
Apr 6, 2023
1.3.0: April Update
Reworked metrics (ability to ignore, improved reports, new metrics), dcm fix on save, baseline support, new rules, command improvements and more!
- Completely reworked metrics 🚀:
- Metrics calculation is moved to a separate command
dcm calculate-metrics
- Ability to ignore metrics!
- Reworked reports: only enabled metrics are displayed, ability to sort columns, reports display additional info like max, min, avg for each metric
- Only enabled metrics are calculated
8 new metrics 🔥
Common:- Number of imports (NOI)
- Depth of inheritance tree (DIT)
- Coupling between object classes (CBO)
- Response for a class (RFC)
- Tight class cohesion (TCC)
- Weighted methods per class (WMC)
- Number of used widgets (NUW)
- Widgets nesting level (WNL)
- Metrics calculation is moved to a separate command
- Rules update: 11 new rules 🔥
Common:- prefer-explicit-parameter-names
- prefer-correct-switch-length
- avoid-equal-expressions
- avoid-declaring-call-method
- prefer-bytes-builder
- prefer-early-return
- banned-usage
- avoid-missed-calls
- dispose-fields
- avoid-empty-setstate
- prefer-widget-private-members
Improved rules (false-positives and new cases):- avoid-collection-methods-with-unrelated-types
- avoid-dynamic
- avoid-redundant-async
- avoid-unnecessary-nullable-return-type
- prefer-moving-to-variable
- unnecessary-trailing-comma
- dcm fix improvements:
Command now applies only to files that had any issues.
+ 2 rule supported:- prefer-correct-edge-insets
- prefer-immediate-return
- Command improvements:
- All commands now have aliases to type them faster 🚀
- Unused files search now detects one level of cyclic usage
- Unnecessary nullable correctly handles tear-offs, redirecting constructors and external members
- Improved memory consumption by unused code and unnecessary nullable checks
dcm analyze
now prints a summary
- VS Code extension updates:
- Supports
dcm.source.fixAll
to apply dcm fix on save 🚀🚀🚀 - Adds a command to fix all issues in a file with a shortcut
ctrl / cmd + shift + S
.
- Supports
- IntelliJ plugin update:
- Adds a command to fix all issues in file with a shortcut
ctrl / cmd + shift + S
- Supports "Extract to new file" code action
- Provides code actions in analysis_options
- Shows configurable rule icons in analysis_options
- Fixed quick fix actions order
- Supports option + enter shortcut in problems view
- Adds a command to fix all issues in file with a shortcut
- New command dcm init to calculate baseline 🔥: Allows you to generate a baseline for your project used both by IDE and CLI to gradually adopt DCM and skip fixing all existing issues.
- Updates from Individuals version: all updates up to 5.7.0
Mar 6, 2023
1.2.0: March Update
Updated dcm fix and unused code check commands, assist to extract a class to a new file, 22 new rules and more! 🚀
- More rules supported by dcm fix 🔥:
- avoid-border-all
- avoid-duplicate-exports
- avoid-explicit-type-declarations
- avoid-late-keyword
- avoid-redundant-else
- avoid-self-assignment
- avoid-unnecessary-conditionals
- avoid-unused-parameters
- binary-expression-operand-order
- double-literal-format
- newline-before-return
- prefer-const-border-radius
- prefer-declaring-const-constructor
- prefer-iterable-of
- prefer-return-await
- proper-super-calls
- unnecessary-trailing-comma
- arguments-ordering
- New dcm fix options:
--include-rules
- allows you to add rules that are not listed in your config, but you want to apply their fixes as well--exclude-rules
- allows you to exclude rules listed in your config from fixes calculation--only-rules
- allows you to run calculate fixes only for the given list of rules--dry-run
- allows you to see the proposed changes without applying them--apply-to
- allows you to run fixes only for the listed files
- Support for removing unused code via dcm fix: dcm fix now supports removing unused code via --type option.
- Improved unused code check: Unused code now correctly handles complex cases with conditionally exported files.
- Performance improvements: Improved rules and quick fixes calculation.
- Deprecating anti-patterns: Anti-patterns long-parameter-list and long-method were removed, use corresponding rules avoid-long-parameter-list and avoid-long-functions instead.
- Extended support for analysis_options.yaml: Rules that have an additional configuration are highlights with ⚙️ icon. New code actions to disable, configure, open rule documentation or change severity are now available.
- Extract to a new file assist: New refactoring assist to extract classes to a new file. It also supports extracting state if a widget was selected.
- New rules 🚀: Common:
- avoid-long-parameter-list
- avoid-long-functions
- prefer-return-await
- unnecessary-trailing-comma
- avoid-duplicate-named-imports
- avoid-shadowing
- proper-super-calls
- add-copy-with
- avoid-cubits
- avoid-bloc-public-methods
- avoid-passing-bloc-to-bloc
- prefer-multi-bloc-provider
- prefer-correct-bloc-provider
- extend-equatable
- prefer-publish-to-none
- prefer-correct-package-name
- prefer-semver-version
- avoid-dependency-overrides
- prefer-caret-version-syntax
- avoid-any-version
- prefer-correct-screenshots
- banned-dependencies
Feb 8, 2023
1.1.0: February Update
Improved unused code, dcm fix and more! 🚀
- Improved check unused code 🔥: the command now searches for all type of unused code.
- Applying quick fixes with dcm fix 🎯: new command to apply quick fixes produced.
- New command - Check Exports Completeness: Checks that an exported API exports all used types (even transitive).
- New rules 🚀:
- avoid-self-assignment
- avoid-redundant-else
- no-equal-switch-case
- avoid-explicit-type-declaration
- avoid-self-compare
- avoid-nested-switches
- avoid-similar-names
- no-equal-conditions
- avoid-collapsible-if
- avoid-incomplete-copy-with
- Reporting of unused "//ignore" comments: All ignore comments that do not affect any produced diagnostic are now reported as unused.
- Analysis options changes are picked up after each save: No need to restart the analysis server anymore. All the changes to config are now picked up after the save and applied to the affected files!
- Quick fixes 🔥:
- quick fix for "list-all-equatable-fields".
- quick fix for "avoid-redundant-async-on-load".
- Updates from Individuals version: all updates up to 5.6.0
Jan 18, 2023
1.0.0: Teams Version Release
Initial release of Teams version, including VS Code extension and IntelliJ / Android Studio plugin releases.
- New rules 🚀: avoid-unnecessary-nullable-return-type, avoid-unrelated-type-casts, format-test-name, prefer-declaring-const-constructor, prefer-provide-intl-description.
- New command:
dcm share-feedback
to open the feedback form. - Quick fixes 🔥:
- new quick fix "fix all in a file".
- new quick fix "fix all of type".
- new quick fix "ignore" and "ignore in file".
- existing rules that now support quick fixes: - avoid-duplicate-exports - avoid-late-keyword - avoid-redundant-async - avoid-top-level-members-in-tests - avoid-unnecessary-type-assertions - avoid-unnecessary-type-casts - avoid-unrelated-type-assertions - avoid-unused-parameters - newline-before-return - no-equal-then-else - prefer-match-file-name - member-ordering.
- avoid-late-keyword updates: new config options
allow-initialized
andignored-types
. - prefer-moving-to-variable updates: correctly handle prefixed enums and static instance fields, ignore method invocations in a variable declaration.
- no-magic-number updates: ignore enum constant arguments.
- VS Code Extension: you can read more about the VS Code extension here.
- IntelliJ plugin: you can read more about the VS Code extension here.