Changelog
Public Roadmap →Nov 11, 2024
1.24.0: November Update
17 new rules (6 for Bloc and 4 for Flutter); autocompletion for DCM configuration in analysis_options.yaml; improved validation for rules and metrics in DCM configuration; a new "exclude" configuration for better flexibility; a new fixes type called "unsafe fixes"; updated "recommended" preset and more 🚀
- Rules update: 17 new rules 🔥
Common:- avoid-negations-in-equality-checks 🛠
- avoid-incorrect-uri
- function-always-returns-same-value
- prefer-add-all
- prefer-for-in
- avoid-adjacent-strings
- prefer-sized-box-square
- avoid-flexible-outside-flex
- prefer-center-over-align 🛠
- prefer-padding-over-container 🛠
- prefer-bloc-extensions
- avoid-duplicate-bloc-event-handlers
- handle-bloc-event-subclasses
- avoid-passing-build-context-to-blocs
- prefer-sealed-bloc-events ⚙️
- prefer-sealed-bloc-state ⚙️
Improved rules (false-positives and new cases):- prefer-correct-bloc-provider
- avoid-referencing-subclasses
- avoid-unnecessary-overrides
- avoid-unused-assignment
- prefer-pinned-version-syntax
- use-existing-variable
- avoid-bottom-type-in-records
- avoid-bottom-type-in-patterns
- avoid-passing-self-as-argument
- prefer-correct-handler-name
- prefer-moving-to-variable
- check-is-not-closed-after-async-gap
- avoid-unnecessary-negations
- prefer-overriding-parent-equality
- missing-test-assertion
- avoid-inferrable-type-arguments
- prefer-parentheses-with-if-null
- avoid-wrapping-in-padding
- prefer-conditional-expressions
- avoid-wildcard-cases-with-enums
- new config option ignored-annotations for avoid-referencing-subclasses
- new config option ignored-invocations for avoid-undisposed-instances
- new config option ignored-types for avoid-duplicate-cascades
- New utility command to check the active license: New command "dcm license" to check if a device has an active DCM license. Prints the license type
- Documentation improvements:
- Added new guide for the Codemagic CI/CD integration
- Added new guide for detecting unused assets
- Added new guide for choosing first DCM rules
- Added new guide for understanding the "exclude-public-api" flag
- Added new page for DCM Demo
- General command improvements:
- Ignore comments for refactoring commands now should be added after the documentation comments (same as for the lint rules)
- Changed how "rules-exclude" and "metrics-exclude" affect rules and metrics analysis to make it consistent with the Dart analyzer
- Configuration improvements:
- Added IDE autocompletion for analysis_options configuration (VS Code only)
- Added support for the new "exclude" entry in analysis_options configuration that allows adding separate excludes for rules, metrics, unused code, unused files and parameters
- Added new code actions for inserting "include" and "exclude" configuration options for rules in analysis_options.yaml
- Added validation for all rules configuration (for both names and value types)
- Added validation for metric names and value types
- Added new code actions for metrics in analysis_options.yaml
- ❗️ "unused-code-exclude" analysis_options config entry was removed. Use the "unused-code" section in the "exclude" configuration entry instead
- Fixed several issues with yaml config parsing when the input is invalid
- Check Unused Code improvements:
- Added support for detecting unused assets when the "flutter_gen" package is used 🚀
- ❗️ "unused-code-exclude" analysis_options config entry was removed. Use the "unused-code" section in the "exclude" configuration entry instead
- Fix improvements:
- Added new category of fixes called "unsafe fixes"
- Added a new hint when a rule does not support a fix and is passed via "--include-rules" or "--only-rules" flags
- Check Dependencies improvements:
- Added support for global and local ignore comments
- Check Unused Localization improvements:
- Updated the default value of the "--class-pattern" CLI option to be "^AppLocalizations$"
- Check Exports Completeness improvements:
- Fixed an issue with type arguments not being included into the exports graph
- Analyze Assets improvements:
- Fixed an issue with not validating if the passed asset exists
- Fixed an issue with assets being reported several times in some cases
- Presets:
- ❗️ The "recommended" preset now includes some new rules from previous releases
Oct 10, 2024
1.23.0: October Update
9 new rules; 9 new quick fixes; new command to analyze assets for exceeding size, incorrect formats and other issues; unused code detection for code used only in tests; duplicate test cases detection; reworked "monorepo" CLI option; completely reworked documentation for rules and it now includes better issue highlighting, more examples and more 🚀
- Rules update: 9 new rules 🔥
Common:- prefer-simpler-boolean-expressions
- avoid-late-final-reassignment
- avoid-referencing-subclasses
- avoid-high-cyclomatic-complexity ⚙️
- use-existing-variable 🛠
- avoid-complex-loop-conditions
- avoid-non-empty-constructor-bodies
Improved rules (false-positives and new cases):- avoid-getter-prefix
- avoid-undisposed-instances
- avoid-unused-assignment
- prefer-correct-identifier-length
- avoid-missed-calls
- avoid-missing-interpolation
- prefer-explicit-type-arguments
- avoid-shadowing
- avoid-duplicate-initializers
- avoid-unnecessary-local-late
- no-magic-number
- avoid-long-functions
- prefer-enums-by-name
- newline-before-method
- fixed quick fix for avoid-collapsible-if
- fixed quick fix for prefer-private-extension-type-field
- fixed quick fix for prefer-correct-error-name
- new quick fix for prefer-correct-setter-parameter-name
- new quick fix for prefer-correct-throws
- new quick fix for avoid-suspicious-super-overrides
- new quick fix for avoid-non-final-exception-class-fields
- new quick fix for avoid-duplicate-patterns
- new quick fix for avoid-casting-to-extension-type
- new quick fix for avoid-unnecessary-super
- new quick fix for avoid-missing-tr
- new quick fix for avoid-missing-image-alt
- new config option ignore-inline-functions for prefer-correct-identifier-length
- new config option first for arguments-ordering
- new config option ignore-instances for no-magic-number
- new config option ignored-invocations for prefer-moving-to-variable
- New command to analyze assets 🚀: New command to analyze image assets for incorrect formats, names, exceeding size, and missing high-resolution images
- Documentation improvements:
- Each rule page now has an improved issue highlighting (proper region and the issue message)
- Each rule page now has a list of related rules to help with discoverability
- Some rules with additional config now have code examples specifically for their config options
- Some rules are now categorized as addressing "CWE" issues
- Some rules now have an updated description to better reflect the problem they address
- Fixed an issue with the missing "has fix" indicator for "prefer-dedicated-media-query-methods", "avoid-unnecessary-call" and "prefer-public-exception-classes"
- DCM Teams Console improvements:
- Fixed an issue with the billing button being disabled
- General command improvements:
- ❗️ "--monorepo" flag was replaced with "--exclude-public-api" and now the default behavior for commands is if the "--monorepo" flag is passed
- All outputs of "--reporter=sonar" now include the "effortMinutes" field (the number depends on the type of command, rule or metric)
- Analyze command improvements:
- Fixed an issue with inconsistent ordering of severity entries in the command summary
- Check Unused Code improvements:
- Now supports detecting code that is used only in tests and is technically unused 🔥
- Check Code Duplication improvements:
- Now supports detecting duplicate tests cases 🚀
- Calculate Metrics improvements:
- Added a new CLI option "--flat" to generate an HTML report with only files (skipping their folders)
- Check Dependencies improvements:
- "json_serializable" is now skipped when "freezed_annotation" is used
- Check Unused Localization improvements:
- Updated the description of the "--class-pattern" CLI option to clearly indicate that a regular expression is expected
- Analyze Widgets improvements:
- Fixed an issue where the "Name" column in the HTML report would not save the selected sort order
- Format improvements:
- Added a new CLI option "--exclude" to exclude specific files
- IntelliJ plugin update:
- Updated the plugin to support the latest IntelliJ Platform API
Sep 6, 2024
1.22.0: September Update
15 new rules, ignore comments support for pubspec rules, DCM Teams Console improvements, and general UX improvements 🚀
- Rules update: 15 new rules 🔥
Common:- avoid-unnecessary-extends 🛠
- avoid-assignments-as-conditions
- avoid-type-casts ⚙️
- avoid-unused-assignment
- avoid-unnecessary-overrides 🛠
- avoid-duplicate-constant-values
- avoid-unnecessary-enum-arguments 🛠
- prefer-contains 🛠
- avoid-unnecessary-constructor 🛠
- avoid-implicitly-nullable-extension-types 🛠
- avoid-getter-prefix ⚙️
- avoid-assigning-to-static-field
- avoid-unnecessary-enum-prefix 🛠
- avoid-non-final-exception-class-fields
Improved rules (false-positives and new cases):- avoid-non-null-assertion
- avoid-nullable-interpolation
- avoid-unsafe-reduce
- dispose-provided-instances
- format-comment
- prefer-boolean-prefixes
- avoid-unsafe-collection-methods
- avoid-misused-test-matchers
- prefer-abstract-final-static-class
- avoid-unnecessary-negations
- prefer-null-aware-spread
- avoid-unrelated-type-casts
- avoid-unnecessary-type-casts
- prefer-moving-to-variable
- avoid-unused-after-null-check
- avoid-self-assignment
- binary-expression-operand-order
- avoid-unnecessary-overrides-in-state
- prefer-overriding-parent-equality
- new config option ignored-annotations for prefer-boolean-prefixes
- DCM Teams Console improvements:
- Added new modal to reset the CI/CD key and email
- Added a search bar to simplify working with the list of developers
- Added support for multiple login emails
- Added toast notifications to show errors during login or adding developers
- Analyze command improvements:
- Added support for global and local ignores for pubspec rules (via "# ignore: rule-name" and "# ignore_for_file: rule-name" comments)
- "Not found preset" issues are now displayed on the "extends:" entry only
Aug 9, 2024
1.21.0: August Update
9 new rules, reworked "banned-usage" rule, new reporter format for SonarQube, new "Guides" section in the documentation, and general UX improvements 🚀
- Rules update: 9 new rules 🔥
Common:- prefer-boolean-prefixes
- avoid-banned-names
- avoid-misused-set-literals
- dispose-class-fields
- avoid-suspicious-super-overrides
- newline-before-method
- avoid-missing-tr
- incorrect-firebase-event-name
- incorrect-firebase-parameter-name
❗️ Rule breaking changes- banned-usage now works only for usages (e.g. method invocations or property accesses), use avoid-banned-names to ban declaration names
- ban-name has been removed, use avoid-banned-names instead
Improved rules (false-positives and new cases):- dispose-provided-instances
- prefer-correct-throws
- prefer-moving-to-variable
- prefer-correct-identifier-length
- avoid-getx-rx-inside-build
- avoid-collection-mutating-methods
- avoid-passing-self-as-argument
- use-setstate-synchronously
- use-ref-read-synchronously
- check-is-not-closed-after-async-gap
- prefer-first
- prefer-last
- avoid-self-assignment
- handle-throwing-invocations
- avoid-unsafe-reduce
- avoid-calling-notifier-members-inside-build
- avoid-returning-cascades
- always-remove-listener
- always-remove-getx-listener
- avoid-duplicate-cascades
- prefer-extracting-function-callbacks
- no-empty-block
- prefer-simpler-patterns-null-check
- avoid-misused-hooks
- prefer-use-prefix
- prefer-correct-test-file-name
- avoid-unnecessary-nullable-return-type
- avoid-redundant-async
- avoid-unnecessary-super
- new config option only-named for parameters-ordering
- new config option ignored-invocations for prefer-extracting-function-callbacks
- new config option alphabetize for arguments-ordering
- new config option additional-methods for avoid-hooks-outside-build
- Documentation improvements:
- Added new guide for the Azure CI/CD integration
- Added rule tags (e.g. "correctness", "consistency", "maintainability")
- Added new section for guides and the first two guides
- Removed "ban-name" and "check-unnecessary-nullable" docs
- DCM Teams Console improvements:
- Added a new field for the license email
- Fixed an issue with sending a deactivated key in an invitation email
- Fixed an issue with the "Resend invitation" button sending several emails at once
- General command improvements:
- Added new reporter format for SonarQube
- ❗️ Fixed an issue with the "dot" format being not available to Pro users
- Analyze command improvements:
- Added support for additional test folders ("integration_test" and "test_driver") for all rules
- Fixed an issue with the optional severity configuration being printed as "null"
- Analyze Structure improvements:
- Added a hint about what tools can be used to visualize the "dot" format
- Check Dependencies improvements:
- Changed the value of checkstyle's "source" and codeclimate's "check_name" to have unique issues type (e.g. "unused-dependency-issue", not just "dependency-issue")
- Check Parameters improvements:
- Fixed an issue that prevented constructor field initializers from being included into the analysis
- Fixed an issue with multiple constructor declarations being analyzed separately
July 10, 2024
1.19.0: July Update
9 new rules (4 for Riverpod 🚀), documentation improvements, proper codegen packages support for "check-dependencies", new "dcm fix" type to fix "check-unused-files" issues, new summary output to sdterr for various reporters, new visualization of the statically resolved widget trees for "analyze-widgets" and many other DX improvements 🚀🚀🚀
- Rules update: 9 new rules 🔥
Common:- handle-throwing-invocations
- prefer-correct-throws
- prefer-extracting-function-callbacks
- avoid-incorrect-image-opacity
- use-ref-read-synchronously
- avoid-calling-notifier-members-inside-build
- avoid-notifier-constructors
- dispose-provided-instances
- proper-getx-super-calls
Improved rules (false-positives and new cases):- avoid-accessing-collections-by-constant-index
- avoid-getx-rx-inside-build
- avoid-passing-self-as-argument
- avoid-only-rethrow
- avoid-unsafe-reduce
- prefer-specific-cases-first
- avoid-undisposed-instances
- avoid-nested-conditional-expressions
- avoid-contradictory-expressions
- avoid-equal-expressions
- no-equal-switch-case
- prefer-any-or-every
- avoid-unsafe-collection-methods
- no-equal-switch-expression-cases
- new config option paths for banned-usage
- new config option banned-transitive for banned-dependencies
- new config option ignore-after-if for move-variable-closer-to-its-usage
- Documentation improvements:
- Added new entrypoint page to simplify navigation to other sections
- Added new guides for GitLab and Bitbucket CI/CD integrations
- Added new "Introduction" section
- Reworked the "Getting Started" page into several more detailed pages to improve the onboarding experience
- Added documentation for the DCM Teams Console (finally)
- Added new categories for commands and metrics to simplify finding relevant ones
- General command improvements:
- Improved the error message for cases when the SDK is not found message
- Added new abbreviations for several CLI options ("-s" for "--sdk-path", "-e" for "--exclude", "-m" for "--monorepo" and "-t" for "--type")
- ❗️ Changed the allowed list of reporters for Individuals plan to be only the Console reporter
- Improved the "--congratulate" flag by disabling it by default for any reporter that is not the Consoler or HTML reporter
- Added new summary report (sent to stderr) for Codeclimate, JSON, GitLab and Checkstyle reporters for all commands
- Added a new hint when the dependencies are not installed to help avoid cases when "flutter pub get" is not run before DCM commands
- Fixed an issue with JSON reporter producing reports for files with zero issues
- Analyze command improvements:
- ❗️ Removed the performance severity. All rules that had the performance severity are now warnings
- Fixed an issue with parsing errors showing in IDEs for rules that have the "entries" config option
- Fix command improvements:
- Added new fix type for removing unused files (moved from check-unused-files)
- Fixed an issue with extra separators being applied to the "--dry-run" mode output
- Check Unused Code improvements:
- Changed the command summary to only mention "top-level declarations" and "class members"
- Check Unused Localization improvements:
- Changed the command summary to only only mention "declarations"
- Calculate Metrics improvements:
- Added new tooltip to the HTML report header to show the full name of each metric
- Changed the "--report-all" CLI option to apply to all reporters, not just the Console reporter
- Fixed an issue with the JSON reporter always reporting all metrics, not just violations
- Fixed an issue with "Directory" and "File" columns in the HTML report not sharing the same sorting
- Fixed an issue with the Number of Parameters metric skipping static factory methods
- Analyze Widgets improvements:
- Added visualization of the statically resolved widget trees
- Improved detection of more complex trees (for example, with methods returning widgets, external properties, switches and so on)
- Added a hint to the "Similar Widgets" section in HTML report if the "--show-similarity" flag is not enabled
- Changed the "--report-all" CLI option to apply to all reporters, not just the Console reporter
- Fixed an issue with the JSON reporter always reporting all widgets, not just low- or medium-quality widgets
- Fixed an issue with the similarity percentage including the same branch several times
- Fixed an issue where "build" methods starting with an expression function were not included in the similarity report
- Check Parameters improvements:
- Fixed an issue with private types being suggested for "--show-broad-types"
- Fixed an issue with redirecting factory constructors being analyzed by "show-never-passed", "show-always-passed", "--show-same-value " and "--show-broad-types" checks
- Fixed an issue with different constructor invocations of the same class being incorrectly treated as independent invocations
- Check Dependencies improvements:
- Added a new hint for packages that are used for codegen to double-check them manually
- "flutter_gen", "flutter_launcher_icons" and "flutter_native_splash" are now skipped if the pubspec file has a related config entry for those packages
- Added automatic skip of various codegen packages if their corresponding regular package is used
- Changed how analysis options are being parsed (instead of regexp the command now looks for "include" and "plugin" entries only)
- Supported reporting of codegen packages if they are added to the regular dependencies
- Check Exports Completeness improvements:
- Improved entry point files detection (this change also affects the "monorepo" mode for all commands that has it)
- Check Unused Files improvements:
- Added support for additional test folders ("integration_test" and "test_driver")
- ❗️ Removed the "--delete-files" CLI flag
- Removed the 'automaticallyDeleted' from the JSON output format
June 6, 2024
1.18.0: June Update
8 new rules, improved "New Version" notifications, new grouping option for IntelliJ plugin, automatic DCM version detection by the "setup-dcm" action and general UX improvements 🚀
- Rules update: 8 new rules 🔥
Common:- avoid-returning-cascades
- avoid-only-rethrow
- prefer-named-parameters
- prefer-abstract-final-static-class
- avoid-unsafe-reduce
- avoid-getx-rx-inside-build
- dispose-getx-fields
- always-remove-getx-listener
Improved rules (false-positives and new cases):- banned-usage
- avoid-unnecessary-stateful-widgets
- avoid-misused-hooks
- dispose-fields
- prefer-single-declaration-per-file
- avoid-shadowing
- move-variable-outside-iteration
- use-setstate-synchronously
- member-ordering
- no-magic-string
- avoid-collection-mutating-methods
- prefer-correct-callback-field-name
- prefer-moving-to-variable
- prefer-switch-with-sealed-classes
- prefer-named-boolean-parameters
- avoid-ref-watch-outside-build
- avoid-passing-self-as-argument
- avoid-non-null-assertion
- avoid-stateless-widget-initialized-fields
- avoid-undisposed-instances
- config option max-amount for avoid-long-parameter-list has been renamed to max-number
- config option max-amount for avoid-long-records has been renamed to max-number
- config option ignore-get-x for always-remove-listener has been removed
- named getters and setters support for member-ordering
- General command improvements:
- New global CLI option called "--show-installation-hint" that prints a hint on how to install the current DCM version on any platform
- Version update command on Mac OS now includes "brew tap" to update the list of available DCM versions
- HTML report tables for "calculate-metrics" and "analyze-widgets" commands now have a sticky header
- Version update command on Linux now correctly suggests relevant apt-get commands
- Unused localization improvements:
- Fields named "localeName" and "delegate" are not excluded by the command
- Unnecessary nullable improvements:
- This command has been removed. Consider using "check-parameters" instead
- Check dependencies improvements:
- Command now correctly marks packages listed in asset transformers as being used
- Analyze structure improvements:
- Hashes of excluded files will no longer be visible in the command's output
- Analyze widgets improvements:
- The command now correctly shows separate widget types for "HookWidgets", "StatefulHookWidgets", "HookConsumerWidgets", "StatefulHookConsumerWidgets", "ConsumerWidgets" and "ConsumerStatefulWidgets"
- Presets:
- Added new preset for GetX
- VS Code extension update:
- New version update notification now has a button to copy the update command
- Added 2 new IDE commands to open rules and metrics doc pages
- Added 2 new IDE commands to toggle unused code / unused files issues
- Formatter exceptions now include more information on what caused them
- Fixed an issue with the new version notification not showing in some cases
- IntelliJ plugin update:
- New version update notification now has a button to copy the update command
- DCM issues panel now has dedicated buttons to toggle unused code / unused files issues
- DCM issues panel now has a new grouping option called "Group by Rule Name"
- DCM issues panel now allows to sort issues by severity and the number of problems
- Added 2 new IDE actions to open rules and metrics doc pages
- Added a new config option to analyze only opened packages
- Fixed a critical performance issue related to the new version update notification. Consider updating to the latest version of the plugin
- GitHub Action:
- Support for automatic DCM version detection (based on the "dcm_global.yaml" config)
May 10, 2024
1.17.0: May Update
9 new rules (3 for Riverpod), early access to the DCM Teams license management portal, per-package monorepo mode, global configuration with DCM version constrains and more 🚀🚀🚀
- Rules update: 9 new rules 🔥
Common:- avoid-collection-equality-checks
- avoid-multi-assignment
- prefer-switch-with-sealed-classes
- prefer-single-declaration-per-file
- prefer-use-callback
- avoid-misused-hooks
- avoid-ref-read-inside-build
- avoid-ref-watch-outside-build
- avoid-unnecessary-consumer-widgets
Improved rules (false-positives and new cases):- avoid-inferrable-type-arguments
- arguments-ordering
- avoid-unnecessary-type-casts
- dispose-fields
- prefer-extracting-callbacks
- no-magic-string
- avoid-non-ascii-symbols
- prefer-overriding-parent-equality
- avoid-passing-default-values
- prefer-specific-cases-first
- format-comment
- avoid-not-encodable-in-to-json
- avoid-unsafe-collection-methods
- avoid-unnecessary-hook-widgets
- missing-test-assertion
- avoid-conditional-hooks
- avoid-hooks-outside-build
- prefer-use-prefix
- avoid-unrelated-type-assertions
- avoid-nullable-interpolation
- avoid-unnecessary-type-assertions
- avoid-nullable-tostring
- avoid-unnecessary-collections
- prefer-commenting-analyzer-ignores
- prefer-switch-with-enums
- avoid-contradictory-expressions
- avoid-excessive-expressions
- avoid-redundant-async
- function-always-returns-null
- banned-usage
- avoid-unnecessary-stateful-widgets
- prefer-number-format
- prefer-date-format
- prefer-single-widget-per-file
- avoid-top-level-members-in-tests
- avoid-unused-generics
- member-ordering
- config option types for missing-use-result-annotation has been renamed to type-pattern and now takes a regular expression
- new config option (methods) for avoid-not-encodable-in-to-json
- new config option (ignore-global) for prefer-commenting-analyzer-ignores
- new config option (ignored-invocations) for prefer-number-format
- new config option (ignored-invocations) for prefer-date-format
- new config option (ignore-overridden) for avoid-unused-generics
- new config option (ignore-await) for prefer-getter-over-method
- DCM Teams license management portal 🚀: Early access to the DCM Teams Console to manage keys, seats and access.
- Global configuration with DCM version constraints 🚀: Support for "dcm_global.yaml" file with DCM version constraints to help you synchronize the installed DCM version within your team.
- Configuration improvements:
- New "monorepo" configuration entry to configure monorepo mode on a per-package basis for commands such as "check-unused-code", "check-unused-files", and others.
- General command improvements:
- Passing the "--print-config" option now prints the config regardless of the "--no-congratulate" option
- Fixed an issue with the new version update being displayed for "dcm run"
- Unused localization improvements:
- Passing the "--class-pattern" option is now required for the command to show any output
- Added a hint for cases when the passed "--class-pattern" regular expression has not matched any of the classes
- Analyze parameters improvements:
- Super parameters are now excluded from the analysis
- Metrics improvements:
- Fixed an issue with cyclomatic-complexity not including null-aware spreads, null-aware index expressions and if elements
- Fixed an issue with widgets-nesting-level not counting widgets nesting from locally declared variables
- Presets:
- Added new preset for Riverpod
- Recommended preset now includes some rules from 1.14.0, 1.15.0 and 1.16.0
Apr 8, 2024
1.16.0: April Update
5 new rules, new command for advanced parameters analysis (not just unnecessary nullable), new command to analyze project structure, improved "dcm fix" and more 🚀
- Rules update: 5 new rules 🔥
Common:- missing-use-result-annotation
- avoid-conditions-with-boolean-literals
- no-magic-string
- prefer-for-loop-in-children
- avoid-unnecessary-hook-widgets
All quick fixes were updated to keep comments when necessary
Improved rules (false-positives and new cases):- prefer-declaring-const-constructors
- avoid-unused-generics
- avoid-substring
- avoid-duplicate-collection-elements
- map-keys-ordering
- avoid-unnecessary-type-casts
- avoid-duplicate-test-assertions
- avoid-collection-methods-with-unrelated-types
- avoid-collection-mutating-methods
- prefer-simpler-patterns-null-check
- prefer-moving-to-variable
- prefer-enums-by-name
- avoid-missing-image-alt
- prefer-overriding-parent-equality
- avoid-unnecessary-collections
- move-variable-outside-iteration
- avoid-duplicate-initializers
- avoid-unused-after-null-check
- no-equal-arguments
- prefer-correct-edge-insets-constructor
- avoid-inferrable-type-arguments
- prefer-const-border-radius
- member-ordering
- avoid-duplicate-mixins
- avoid-duplicate-cascades
- avoid-conditional-hooks
- avoid-hooks-outside-build
- prefer-use-prefix
- proper-super-calls
- list-all-equatable-fields
- avoid-declaring-call-method
- avoid-unnecessary-overrides-in-state
- prefer-number-format
- prefer-date-format
- prefer-specific-cases-first
- prefer-getter-over-method
- avoid-returning-widgets
- avoid-unnecessary-nullable-return-type
- prefer-extracting-callbacks
- prefer-match-file-name
- avoid-redundant-async
- avoid-unrelated-type-assertions
- avoid-misused-test-matchers
- avoid-unsafe-collection-methods
- avoid-non-ascii-symbols
- new config option (ignored-names) for prefer-getter-over-method
- new config option (ignore-literals) for avoid-duplicate-collection-elements
- new config option (ignore-fallthrough-cases) for prefer-correct-switch-length
- new config option (ignore-svg) for avoid-missing-image-alt
- new config option (name-pattern) for banned-usage
- new config option (ignore-get-x) for dispose-fields
- new config option (last) for arguments-ordering
- new config option (ignore-null-checks) for avoid-negated-conditions
- new config option (ignore-get-x) for always-remove-listener
- new config option (ignore-private) for prefer-prefixed-global-constants
- New command to analyze parameters 🚀: New command to find parameters that are never passed, parameters with unnecessary nullable types, parameters that are unnecessary marked as optional, parameters that always get the same value, parameters with unused default values, and more. This command replaces the "check-unnecessary-nullable" command.
- New command to analyze project structure 🚀: New command to visualize how files depend on each other (imports, exports, parts) and how they depend on external packages.
- General command improvements:
- The help for the "dcm fix" and "dcm run" commands now has separators for options for different subcommands
- Passing options that do not affect the output of the "dcm run" command now results in a usage exception
- CLI usage errors now have a separate color to make them easier to spot
- Analyze widgets improvements:
- '--print-config' now includes more configuration options
- Metrics configuration now gets picked up from the context configuration
- Fix improvements:
- Fixed several more issues with fixes not applying to certain expressions
- Fixed an issue with the incorrect removal of the "covariant" keyword
- Fixed an issue with the incorrect removal of existing comments
- Fixed an issue with the incorrect removal of newlines
- Fixed an issue with inline comments not moving with associated declarations
- "dcm fix" no longer applies fixes for "avoid-declaring-call-method"
- Baseline improvements:
- Added a new hint to re-create baseline after 90 days
- Added tool's version to the generated JSON
- Fixed an issue with the "update baseline" action being suggested for unused code and unused files issues
- Unused code improvements:
- Fixed an issue where fields with the same name from mixins and base classes were incorrectly marked as unused
- Unnecessary nullable improvements:
- Added deprecation hint
- GitHub Action:
- Fixed an issue where the action did not work correctly with multiple folders
Mar 7, 2024
1.15.0: March Update
13 new rules, 30 new quick fixes, support for Extension Types (including 24 existing rules), Checkstyle format for all commands and more 🚀🚀🚀
- Rules update: 13 new rules 🔥
Common:- avoid-returning-void
- prefer-private-extension-type-field
- avoid-empty-spread
- avoid-renaming-representation-getters
- avoid-missing-completer-stack-trace
- avoid-casting-to-extension-type
- avoid-nested-extension-types
- avoid-slow-collection-methods
- prefer-overriding-parent-equality
- avoid-unnecessary-collections
- avoid-unknown-pragma
- avoid-unnecessary-gesture-detector
- avoid-missing-controller
Extension types support for 24 existing rules
Improved rules (false-positives and new cases):- avoid-unsafe-collection-methods
- avoid-duplicate-initializers
- avoid-misused-test-matchers
- avoid-empty-test-groups
- missing-test-assertion
- prefer-unique-test-names
- dispose-providers
- prefer-conditional-expressions
- format-comment
- arguments-ordering
- avoid-unused-generics
- avoid-throw-objects-without-tostring
- avoid-substring
- avoid-nullable-interpolation
- avoid-single-child-column-or-row
- avoid-unassigned-late-fields
- dispose-fields
- avoid-shadowing
- prefer-correct-test-file-name
- prefer-correct-bloc-provider
- avoid-duplicate-map-keys
- prefer-trailing-comma
- prefer-multi-provider
- prefer-multi-bloc-provider
- avoid-self-assignment
- avoid-unnecessary-type-casts
- avoid-unrelated-type-casts
- prefer-both-inlining-annotations
- list-all-equatable-fields
- avoid-expanded-as-spacer
- prefer-declaring-const-constructor
- avoid-function-type-in-records
- new quick fix for avoid-banned-imports
- new quick fix for avoid-banned-annotations
- new quick fix for avoid-duplicate-test-assertions
- new quick fix for avoid-map-keys-contains
- new quick fix for avoid-nullable-tostring
- new quick fix for prefer-addition-subtraction-assignments
- new quick fix for prefer-moving-to-variable
- new quick fix for avoid-importing-entrypoint-exports
- new quick fix for avoid-duplicate-map-keys
- new quick fix for prefer-explicit-type-arguments
- new quick fix for prefer-both-inlining-annotations
- new quick fix for avoid-cascade-after-if-null
- new quick fix for prefer-parentheses-with-if-null
- new quick fix for prefer-returning-conditional-expressions
- new quick fix for prefer-correct-error-name
- new quick fix for move-variable-outside-iteration
- new quick fix for avoid-negated-conditions
- new quick fix for prefer-specific-cases-first
- new quick fix for enum-constants-ordering
- new quick fix for avoid-equal-expressions
- new quick fix for avoid-duplicate-mixins
- new quick fix for avoid-duplicate-cascades
- new quick fix for move-records-to-typedefs
- new quick fix for prefer-define-hero-tag
- new quick fix for prefer-action-button-tooltip
- new quick fix for prefer-widget-private-members
- new quick fix for prefer-text-rich
- new quick fix for avoid-async-callback-in-fake-async
- new quick fix for avoid-bloc-public-methods
- new quick fix for prefer-correct-bloc-provider
- new config option (ignore-mixins) for member-ordering
- new config option (ignore-extensions) for member-ordering
- new config option (ignore-extension-types) for member-ordering
- new config option (ignore-enums) for member-ordering
- General improvements:
- Extension Types are now supported by all commands and lint rules
- Fixed an issue with an incorrect RegExp on Windows causing unused code command and IDE integration to break
- General command improvements:
- All commands now use a relative path by default as the majority of IDEs / terminals can handle it. For IntelliJ / AS, pass the new "--absolute-path" flag
- Added Checkstyle reporter format for all commands
- Fixed an issue with incorrect isolates creation, which in some cases resulted in poor performance
- Baseline improvements:
- Fixed an issue with an incorrect baseline path on Windows
- Analyze improvements:
- Added a new hint showing how many contexts were skipped due to missing lints configuration
- Metrics improvements:
- Improved missing configuration hint
- Fix improvements:
- Fixed several issues with fixes not applying to certain expressions
- Unused code improvements:
- Updating fields with some collection methods (e.g. ".add()" or ".addAll()") is now not considered as usage in some contexts
- Assigning values to fields is now not considered as usage in some contexts
- Code duplication improvements:
- Fixed an issue where "// ignore: code-duplication" was not affecting declaration members
- Exports improvements:
- Added new warning for publicly exported declaration marked "@internal"
- "@visibleForTesting" parameters are now excluded from the public API graph
- Unused localization improvements:
- Fixed an issue where Code Climate report ids were showing as "unused-code-issue" instead of "unused-localization-issue"
- Check dependencies improvements:
- Dependency issue in JSON reporter now includes two new fields: "targetDependencyType" and "type"
- Configuration improvements:
- Added validation for top-level DCM configuration entries (e.g. "extends", "rules")
- VS Code extension update:
- New IDE command to show/hide issues from baseline
- "New Version" and "Expires Soon" notifications now have new useful actions
- Fixed an issue with missing handler for the "didChangeConfiguration" LSP event
- IntelliJ plugin update:
- New IDE command to show/hide issues from baseline
- "New Version" and "Expires Soon" notifications now have new useful actions
- Fixed an issue with incorrect handling of files that have whitespaces in their names
Feb 7, 2024
1.14.0: February Update
New command to find duplicate code, 4 new rules, new built-in preset to avoid installing an additional package and more 🚀🚀🚀
- Rules update: 4 new rules 🔥
Common:- avoid-empty-test-groups
- avoid-not-encodable-in-to-json
- avoid-contradictory-expressions
- avoid-excessive-expressions
Improved rules (false-positives and new cases):- avoid-missing-test-files
- match-lib-folder-structure
- avoid-collection-methods-with-unrelated-types
- avoid-duplicate-initializers
- avoid-late-context
- avoid-unused-after-null-check
- avoid-unused-parameters
- avoid-weak-cryptographic-algorithms
- banned-usage
- move-variable-outside-iteration
- no-equal-nested-conditions
- avoid-unnecessary-reassignment
- no-magic-number
- check-is-not-closed-after-async-gap
- unnecessary-trailing-comma
- member-ordering
- avoid-missing-interpolation
- avoid-accessing-collections-by-constant-index
- new quick fix for prefer-any-or-every
- new config group (field-getter-setter) for member-ordering
- new config option (severity) for match-class-name-pattern
- new config option (severity) for avoid-banned-annotations
- new config option (severity) for banned-usage
- new config option (severity) for avoid-banned-imports
- new config option (severity) for avoid-banned-types
- new config option (ignored-invocations) for avoid-non-ascii-symbols
- new config option (ignore-overridden) for parameters-ordering
- new config option (ignored-instances) for avoid-undisposed-instances
- new config option (include-methods) for prefer-unique-test-names
- New command to find duplicated code 🚀: New command "dcm check-code-duplication" to find duplicate methods, functions and constructors.
- General command improvements:
- Fixed an issue with commands picking up packages that are excluded in the root analysis_options file
- Analyze widgets improvements:
- Fixed an issue with the similarity column in HTML reports being visible even if similarity is not enabled
- Exports completeness improvements:
- Generated code is now correctly excluded from the command results
- Fixed an issue for declarations in part files displaying an incorrect file path
- Baseline improvements:
- Added a new option for both VS Code and IntelliJ to disable baseline
- Fixed file paths not being platform independent
- Fixed an issue with the "Update baseline" code action not updating the correct baseline file
- Preview improvements:
- Added a new config option to exclude baseline issues from the command output
- Unused code improvements:
- Changing excludes should now properly trigger reanalysis of affected packages (unused code IDE integration)
- Improved transitive conditional reexports detection
- Fix improvements:
- Improved performance for both "Fix on save" and "dcm fix"
- Trial period improvements:
- Removed the "recommended rules by default" behavior for trial licenses
- "dcm analyze" now suggests enabling rules for external packages (e.g. bloc), if they are not yet enabled
- Configuration improvements:
- Added validation for rules with empty configuration (e.g.
- avoid-unused-parameters:
) - Fixed an issue where rules config as a yaml map was not being validated correctly
- Added validation for rules with empty configuration (e.g.
- Presets:
- Added a new built-in preset called 'recommended' that does not require a package as a dependency
- Recommended preset now includes some rules from 1.13.0
Jan 9, 2024
1.13.0: January Update
Similar widgets report, unused files in IDE, new mode for check-unused-code, 8 new rules and much more 🚀
- Rules update: 8 new rules 🔥
Common:- avoid-duplicate-collection-elements
- avoid-duplicate-map-keys
- move-variable-outside-iteration
- avoid-nullable-tostring
- avoid-duplicate-initializers
- avoid-unused-after-null-check
- avoid-unassigned-stream-subscriptions
- avoid-undisposed-instances
Improved rules (false-positives and new cases):- another 14 rules were rewritten to optimize their checks
- avoid-misused-test-matchers
- avoid-inferrable-type-arguments
- always-remove-listener
- avoid-async-call-in-sync-function
- move-variable-closer-to-its-usage
- use-setstate-synchronously
- check-is-not-closed-after-async-gap
- no-equal-switch-case
- no-equal-switch-expression-cases
- avoid-accessing-other-classes-private-members
- no-equal-nested-conditions
- avoid-accessing-collections-by-constant-index
- avoid-conditional-hooks
- prefer-switch-with-enums
- avoid-unrelated-type-assertions
- avoid-unnecessary-return
- avoid-unsafe-collection-methods
- prefer-moving-to-variable
- avoid-function-type-in-records
- dispose-fields
- avoid-unnecessary-type-assertions
- unnecessary-trailing-comma
- avoid-unrelated-type-casts
- new config option (ignore-contains) for prefer-switch-with-enums
- General command improvements:
- Added a hint for the monorepo mode when the '--monorepo' flag is not passed
- Renamed the '--monorepo' flag description
- Completely rewrote the exports analyzer improving performance of 'check-exports-completeness' and all other commands that depend on it
- Fixed an issue with an incorrect path separator for Windows devices that affected several commands and 4 rules. Should now work as expected!
- Unused code improvements:
- Added a new mode to include class member hierarchies into the analysis. You can enable it via the '--no-exclude-overridden' CLI flag
- Added ignore and fix code actions (unused code IDE integration)
- Added new 'unused-code-exclude' config entry to analysis_options that is used by both CLI and the IDE integration
- Excluded
toJson
method from the list of always used methods. The check now relies onjsonEncode
invocations - Improved overall command performance
- Reduced start time (unused code IDE integration)
- Reduced highlighted area of unused code issues to only declaration names (unused code IDE integration)
- Fixed recursive calls incorrectly marked as used
- Fixed a memory leak related to conditional imports calculation (unused code IDE integration)
- Fixed conditional files not being reanalyzed correctly after a file change (unused code IDE integration)
- Fixed conditional elements incorrectly marked as used in certain cases
- Fixed reanalysis of transitive files after a file change (unused code IDE integration)
- Fixed an issue with collecting local references that do no affect the analysis
- Unused files improvements:
- Added unused files display in IDE. You can enable it via 'show unused files' IDE config option (Note, enabling 'Show unused code' is required for this feature to work)
- Files in
lib
that are referenced only in tests should now be reported as unused - Improved overall command performance
- Analyze widget improvements:
- Added reporting of similar widgets. You can enable this check via the '--show-similarity' CLI flag
- Added used metrics configuration to the HTML report
- Improved detection of widgets coming from Flutter
- Fixed an issue with the non-unique widget names not being added to the report
- Fixed missing newlines in the console reporter
- Fixed incorrect total widgets counter
- Run improvements:
- Improved overall command performance
- Fixed an issue with excluded files not updating between different command runs
- Unused L10n improvements:
- Improved overall command performance
- Fixed an issue with handing non-null checks
- Check dependencies improvements:
- Improved overall command performance
- Unnecessary nullable improvements:
- Improved overall command performance
- Fixed detection of
.call()
invocations and excluded references from documentation comments
- GitHub Action:
- Successful runs with 'pull_request_comment_on_fail' should now delete the previously created failed run comment
- Fixed an issue with the 'setup-dcm' action failing to use the cached executable
Dec 8, 2023
1.12.0: December Update
New command to run multiple DCM checks, 7 new rules, custom analysis_options file support, performance improvements and more 🚀🚀🚀
- Rules update: 7 new rules 🔥
Common:- prefer-switch-with-enums
- avoid-misused-test-matchers
- prefer-any-or-every
- avoid-duplicate-test-assertions
- prefer-use-prefix
- avoid-conditional-hooks
- avoid-hooks-outside-build
Improved rules (false-positives and new cases):- 58 rules have been rewritten to optimize their checks. We hope this makes your overall experience a little better!
- avoid-unnecessary-reassignment
- avoid-inferrable-type-arguments
- avoid-unnecessary-setstate
- prefer-return-await
- no-magic-number
- avoid-collection-methods-with-unrelated-types
- avoid-collection-mutating-methods
- avoid-unused-parameters
- parameters-ordering
- prefer-correct-handler-name
- avoid-bottom-type-in-patterns
- avoid-bottom-type-in-records
- no-equal-switch-expression-cases
- no-equal-switch-case
- avoid-collapsible-if
- no-equal-conditions
- avoid-redundant-else
- avoid-unused-instances
- avoid-async-call-in-sync-function
- prefer-test-matchers
- avoid-unnecessary-return
- match-lib-folder-structure
- new config options (ignore-functions and ignore-public) for prefer-correct-handler-name
- new config options (ignore-fields, ignore-parameters, ignore-type-arguments andignore-return-types) for prefer-typedefs-for-callbacks
- new config option (ignored-invocations) for function-always-returns-null
- new config option (ignored-invocations) for avoid-inferrable-type-arguments
- avoid-unassigned-late-fields-keyword has been renamed to avoid-unassigned-late-fields (how did it get there...)
- Custom analysis_options file support: Analysis server now correctly picks up and validates additional config files (e.g. analysis_options.1.1.0.yaml, dcm_analysis_options.yaml or /dcm/**.yaml).
- New command to run multiple checks on CI/CD at once: New command "dcm run" to run multiple DCM commands at once with the merged output. Faster CI/CD as a side effect 🚀.
- Analyze widget improvements:
- Support for widgets that indirectly extend Stateful or Stateless widgets
- Support for widgets that don't override "createState" (e.g. ConsumerWidget)
- Passing "--no-congratulate" now correctly leads to an empty output if the command completes successfully
- New CLI option "--fatal-level" to fail the command when a widget with the given or lower quality is found
- Fixed JSON reporter
- Calculate metrics improvements:
- HTML report no longer has a line indicator if no metrics were calculated for this line
- Passing "--no-congratulate" now correctly leads to an empty output if the command completes successfully
- "--set-exit-on-violation-level" CLI option has been renamed to "--fatal-level"
- Unused code improvements:
- "Enum.values" now correctly marks all enum constants as used even if some of them are not referenced in the code directly
- General command improvements:
- Support for "--json-path" CLI option for all commands that can produce JSON output
- Code Climate reporter not longer produces output for files without issues
- Unified exit codes - now exit code 2 means the command produced some analysis issues and exit code 1 means an error with the command itself
- Some CLI flags are now marked as non-negatable
- Fixed empty JSON and Code Climate output (available in 1.12.1)
- Performance improvements: Analysis server no longer sends empty list of diagnostics if the previous result is the same.
- Website improvements: Rules page now has filters to help you find relevant rules faster! You can also share the link with the applied filters 🚀
- GitHub Action: New input "pull_request_comment_on_fail" to add a comment to the PR only when any DCM checks fail.
- Presets update: Recommended preset now includes some rules from 1.10.0 and 1.11.0 releases.
- VS Code extension update:
- Support for "dart.analysisExcludedFolders" config option
- Support for "dart.onlyAnalyzeProjectsWithOpenFiles" config option
- Validation for the SDK path config option
- IntelliJ plugin update:
- Performance issues are finally fixed. Multithreading is hard!
- New filters menu to filter errors in the problems view by severity
- Validation for the SDK path config option
Nov 7, 2023
1.11.0: November Update
20 new rules, new command to analyze widgets quality and usage, redesigned HTML reports with dark theme support and more 🚀
- Rules update: 20 new rules 🔥
Common:- prefer-null-aware-spread
- prefer-unique-test-names
- avoid-inferrable-type-arguments
- avoid-duplicate-cascades
- prefer-specific-cases-first
- avoid-duplicate-switch-case-conditions
- match-lib-folder-structure
- avoid-missing-test-files
- prefer-both-inlining-annotations
- avoid-collection-mutating-methods
- prefer-explicit-type-arguments
- avoid-unnecessary-super
- prefer-correct-setter-parameter-name
- prefer-prefixed-global-constants
- prefer-correct-callback-field-name
- prefer-explicit-function-type
- prefer-typedefs-for-callbacks
- prefer-correct-handler-name
- prefer-addition-subtraction-assignments
- avoid-banned-annotations
Improved rules (false-positives and new cases):- avoid-single-child-column-or-row
- prefer-named-imports
- dispose-fields
- avoid-non-null-assertion
- avoid-explicit-type-declaration
- avoid-unnecessary-call
- avoid-redundant-async
- prefer-moving-to-variable
- avoid-passing-self-as-argument
- always-remove-listener
- avoid-unnecessary-futures
- avoid-bloc-public-methods
- avoid-unused-parameters
- prefer-getter-over-method
- avoid-async-call-in-sync-function
- avoid-accessing-collections-by-constant-index
- prefer-match-file-name
- avoid-function-type-in-records
- avoid-missed-calls
- avoid-passing-default-values
- use-setstate-synchronously
- double-literal-format
- prefer-declaring-const-constructor
- check-is-not-closed-after-async-gap
- avoid-inherited-widget-in-initstate
- quick fix for avoid-nullable-parameters-with-default-values
- new config option (ignore-upcast) for avoid-unnecessary-getter
- new config option (ignore-abstract) for prefer-declaring-const-constructor
- new config option (explicit-trailing-zero) for double-literal-format
- new config option (ignored-names) for prefer-trailing-comma
- avoid-unnecessary-late has been renamed to avoid-unnecessary-local-late
- Improved baseline: Now a baseline.json file will not be created if the context has zero analysis issues.
- Improved CLI help output: The list of available commands is now split in two: regular commands and commands to manage the license.
- Improved unused code check: Referencing fields only in copyWith is now not considered as usage.
- New command for widgets quality and usage analysis: New command to help you analyze the quality and usage of your widgets. It shows the number widgets / blocs / context.read / context.watch being used, the number of widgets using a particular widget and a widget quality score (based on metrics).
- Improved metrics command:
- Hint to use the HTML reporter if a command supports one
- Hint to use reportAll CLI flag
- New '--open' option to automatically open HTML report after it's created
- Fixed sort order for cells with violations
- Metrics in the report summary now have documentation links
- Support for // ignore: metrics comments
- Improved HTML reports:
- New design!
- Dark theme support
- Persistent sorting
- Improved exports completeness command: Breaking change (!!) - the command now takes the --fatal-found option instead of --fatal-unused.
- IntelliJ plugin update:
- Reduced the number of ProblemsView re-renders
- Supports for IntelliJ modules
- Bump minimal supported IDE version to 2022.3.3
Oct 6, 2023
1.10.0: October Update
14 new rules, new command to deactivate the current device and general UX improvements 🚀
- Rules update: 14 new rules 🔥
Common:- avoid-local-functions
- prefer-named-imports
- avoid-nullable-parameters-with-default-values
- avoid-extensions-on-records
- avoid-accessing-collections-by-constant-index
- avoid-long-files
- avoid-unnecessary-getter
- match-getter-setter-field-names
- avoid-wildcard-cases-with-enums
- avoid-unnecessary-late
- avoid-single-child-column-or-row
- prefer-sliver-prefix
- avoid-functions-in-register-singleton
- prefer-providing-intl-examples
Improved rules (false-positives and new cases):- avoid-missing-interpolation
- avoid-shadowing
- avoid-bloc-public-methods
- prefer-getter-over-method
- avoid-passing-default-values
- unnecessary-trailing-comma
- move-variable-closer-to-its-usage
- avoid-recursive-calls
- avoid-nullable-interpolation
- avoid-referencing-discarded-variables
- avoid-passing-self-as-argument
- avoid-unnecessary-reassignment
- quick fix for prefer-dedicated-media-query-methods
- new config option (default) for parameters-ordering
- new config option (super) for parameters-ordering
- new config option (required) for parameters-ordering
- new config option (skip-checked-fields) for avoid-non-null-assertion
- new config option (trailing-lists) for unnecessary-trailing-comma
- new config option (ignore-abstract) for prefer-declaring-const-constructor
- prefer-provide-intl-description has been renamed to prefer-providing-intl-description
- Improved baseline support: Now when a baseline.json file is created or removed, the analysis server will automatically restart to pick up the changes.
- New command to deactivate current device 🚀: Helps you with migrating the DCM license from an old device to the new one.
- Recommended rules are enabled by default for Trial licenses 🔥: To help you with evaluating DCM faster, new trials will have the recommended set of rules enabled even if DCM is not yet configured.
- Improved logs for dcm fix: When dcm fix fails because of a certain rule you will now get a list of rules that could be the reason.
- Reworked rules messages and highlighted regions: Rule messages are now more actionable and some rules now highligh smaller areas making these rules less annoying.
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.