dart-code-checker / dart-code-metrics

Software analytics tool that helps developers analyse and improve software quality.
https://dcm.dev
Other
860 stars 265 forks source link

[BUG] Not all warnings, suggestions are shown in Dart Analysis tab on Android Studio #1241

Open SametSahin10 opened 1 year ago

SametSahin10 commented 1 year ago

Environment and configuration

DCM version: Dart SDK version: 3.0.2

Configuration ```yaml analyzer: exclude: - "**/*.g.dart" - "**/*.gr.dart" - "**/*.config.dart" - "**/*.freezed.dart" errors: invalid_annotation_target: ignore plugins: - dart_code_metrics dart_code_metrics: extends: - package:dart_code_metrics/presets/all.yaml rules: - avoid-ignoring-return-values: false - prefer-static-class: exclude: - test/** - integration_test/** - format-comment: false # To enabled anti-patterns and metrics in the analysis report, uncomment the sections below. # Metric violations are not shown in the IDE. anti-patterns: - long-method - long-parameter-list metrics: cyclomatic-complexity: 20 maintainability-index: 50 maximum-nesting: 5 number-of-parameters: 5 source-lines-of-code: 50 technical-debt: threshold: 16 todo-cost: 4 ignore-cost: 8 ignore-for-file-cost: 16 as-dynamic-cost: 16 deprecated-annotations-cost: 2 file-nullsafety-migration-cost: 2 unit-type: "hours" # Dart Code Metics provides custom configurable rules. # The rules have a `kebab-case` naming instead of # `snake_case` intentionally in order for you to identify, # whether the rule is from Dart Code Metrics or the standard analyzer. # All rules share basic configuration like `exclude` section, # but some also have a rule-specific one. # Not all rules are listed here, the full list can be found on our website: https://dartcodemetrics.dev/docs/rules # rules: # - avoid-top-level-members-in-tests # - avoid-collection-methods-with-unrelated-types # - avoid-missing-enum-constant-in-map # - avoid-unnecessary-type-assertions # - avoid-unnecessary-type-casts # - avoid-unused-parameters # - newline-before-return # - no-boolean-literal-compare # - no-empty-block # - no-equal-then-else # - prefer-async-await # - prefer-correct-type-name: # max-length: 44 # - prefer-match-file-name: # exclude: # - test/** # - prefer-trailing-comma # This file configures the analyzer, which statically analyzes Dart code to # check for errors, warnings, and lints. # # The issues identified by the analyzer are surfaced in the UI of Dart-enabled # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be # invoked from the command line by running `flutter analyze`. # The following line activates a set of recommended lints for Flutter apps, # packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints # and their documentation is published at # https://dart-lang.github.io/linter/lints/index.html. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code # or a specific dart file by using the `// ignore: name_of_lint` and # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: constant_identifier_names: false # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options ```

What did you do?

I've installed and configured dart_code_metrics for my project.

What did you expect to happen?

I expected to see all warnings and suggestions on the Dart Analysis tab of Android Studio.

What actually happened?

On VS Code, there are over 1K warnings, suggestions but on Android Studio, there are only 11 warnings and 6 hints.

Participation

Additional comments

I'm creating this issue but this could be related to Android Studio as well.

SametSahin10 commented 1 year ago

The warnings and suggestions started showing again. I think it happened when I opened a filed. But this is still an inconvenience.