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

[BUG] avoid-dynamic False Positive #1234

Open
1 task
g5becks opened this issue May 20, 2023 · 2 comments
Open
1 task

[BUG] avoid-dynamic False Positive #1234

g5becks opened this issue May 20, 2023 · 2 comments
Assignees
Labels
type: bug Something isn't working

Comments

@g5becks
Copy link

g5becks commented May 20, 2023

Environment and configuration

DCM version: dart_code_metrics: ^5.7.4
Dart SDK version: 3.0.0 (stable)

Configuration
dart_code_metrics:
  extends:
    - package:dart_code_metrics_presets/all.yaml
  metrics-exclude:
    - test/**
  rules:
    - avoid-late-keyword: false
    - prefer-static-class: false
    - no-magic-number: false
    - format-comment: false

What did you do?

import 'package:rxdart/rxdart.dart' show ReplaySubject;
import 'package:technical_indicators/src/types.dart';

import 'quotes.dart';
import 'util.dart';

Decimal _d(String s) => Decimal.parse(s);

typedef Series<T> = Stream<T>;

typedef QuoteSeries = ReplaySubject<Quote>;

What did you expect to happen?

No dynamic types were used, so I expect the warning not to appear.

What actually happened?

Entire codebase is giving the waring for avoid-dynamic based on this one usage , even though a dynamic type was never used.

The typedef for QuoteSeries is where the warning begins to appear, and continues anywhere else the type is used in the library.

Participation

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

Additional comments

No response

@g5becks g5becks added the type: bug Something isn't working label May 20, 2023
@incendial
Copy link
Member

@g5becks do you have the same problem if you use any Dart version below 3.0?

@g5becks
Copy link
Author

g5becks commented May 21, 2023

@g5becks do you have the same problem if you use any Dart version below 3.0?

I actually haven't tried that. I will give a test and report back.

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