Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

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

Open
1 task
SametSahin10 opened this issue Jun 2, 2023 · 1 comment
Assignees
Labels
type: bug Something isn't working

Comments

@SametSahin10
Copy link

Environment and configuration

DCM version:
Dart SDK version: 3.0.2

Configuration
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

  • I am willing to submit a pull request for this issue.

Additional comments

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

@SametSahin10 SametSahin10 added the type: bug Something isn't working label Jun 2, 2023
@SametSahin10
Copy link
Author

SametSahin10 commented Jun 2, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants