Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Score dropped from 110 to 80 #7848

Closed
quetool opened this issue Jul 4, 2024 · 14 comments
Closed

Score dropped from 110 to 80 #7848

quetool opened this issue Jul 4, 2024 · 14 comments

Comments

@quetool
Copy link

quetool commented Jul 4, 2024

Is something happening with the analyzer? No way I have all of these issues in my package https://pub.dev/packages/web3modal_flutter/versions/3.3.0-beta01/score

Score dropped from 110 to 80. Can you help me address this, pointing me towards the proper direction? Thanks!

@isoos
Copy link
Collaborator

isoos commented Jul 4, 2024

Both the static analysis and the downgrade analysis is failing on the linked prerelease, and the latest stable is also failing static analysis. Do you have a custom analysis_options.yaml that ignores files or warnings/errors?

@quetool
Copy link
Author

quetool commented Jul 4, 2024

Do you have a custom analysis_options.yaml that ignores files or warnings/errors?

Yes, but since 6 month ago, and I used to have 110 points at least.

# 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:lints/recommended.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:
    non_constant_identifier_names: false
    constant_identifier_names: false
    avoid_print: true
    prefer_single_quotes: true
    sort_pub_dependencies: true
    avoid_unnecessary_containers: true
    cancel_subscriptions: true

analyzer:
  exclude:
    - '**.freezed.dart'
    - '**.g.dart'
    - '**/*.freezed.dart'
    - '**/*.g.dart'
    - '**/generated_plugin_registrant.dart'
  errors:
    invalid_annotation_target: ignore
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

@isoos
Copy link
Collaborator

isoos commented Jul 4, 2024

Yes, but since 6 month ago, and I used to have 110 points at least.

As the SDKs or pana used for the analysis, and also as your dependencies evolve, scores may change (in any direction). In this case:

  • it may seem that your lower bound dependency constraints need to be updated, but also your upper bounds may also be off,
  • you don't depend on json_annotation but you reference it in the lib/ files. You depend on json_serializable, but dev dependencies are removed when the analysis runs (similar to how a client of the package may use it)
  • there may be a similar issue with the other missing class

@quetool
Copy link
Author

quetool commented Jul 4, 2024

Thanks, was aware of the dependency constraints but I still feel it's a bug drop. Can I know scores points beforehand in some way?

@isoos
Copy link
Collaborator

isoos commented Jul 4, 2024

Can I know scores points beforehand in some way?

You may run pana from command line:
https://pub.dev/packages/pana#use-as-an-executable

I've seen people running it in github CI on every commit, but for most people it is fine to just check the scores periodically and fix them. Like, in this case, fixing the dependencies. (Note again: score is a dynamic metric, depends on you, on third party dependencies and also on pub-dev).

Closing this as I don't see any direct pana- or pub-dev-related item.

@isoos isoos closed this as completed Jul 4, 2024
@quetool
Copy link
Author

quetool commented Jul 4, 2024

Thanks @isoos ! I'll see what I can resolve!

@isoos
Copy link
Collaborator

isoos commented Jul 4, 2024

No problem. Feel free to reopen if you see anything weird after fixing the dependencies.

@quetool
Copy link
Author

quetool commented Jul 4, 2024

@quetool
Copy link
Author

quetool commented Jul 4, 2024

This is pana output after removing flutter_timezone package. Apparently was the only conflictive one!

Screenshot 2024-07-04 at 12 32 49

By the way, Points used to be 120 total, right? What's about the extra 40 ones? Where can I read about?

@isoos
Copy link
Collaborator

isoos commented Jul 4, 2024

Points used to be 120 total, right? What's about the extra 40 ones? Where can I read about?

We don't have a formal documentation of it outside the codebase of pana (or its changelog). Points are not a static thing, it is evolving as the ecosystem evolves. E.g. ~2 years ago we were giving out extra points for being null-safe, now that section is gone. We may add, remove or restructure sections as we see fit, following new language features or community standards. E.g. the maximum was 140 until like a month ago, when we've introduced the downgrade checks, adding extra 20 points for it.

@quetool
Copy link
Author

quetool commented Jul 4, 2024

Wonderful, thanks for the explanation!

@quetool
Copy link
Author

quetool commented Jul 24, 2024

Hello @isoos! Writing here so I don't open a new issue and create more noise but let me know if you want me to open an issue. Could you explain why I keep getting analysis issues on this repo? https://pub.dev/packages/walletconnect_modal_flutter

pana command gives me Points: 140/160 when running locally.

@isoos
Copy link
Collaborator

isoos commented Jul 25, 2024

@quetool: please open new issues, as the old ones are closed after a specific bug is fixed, and the new symptom may be for a new reason.

In this case it seems to be a dartdoc bug though, which is not on the latest stable on pub.dev, and may have been fixed already. Unfortunately we are in the holiday season, and fixes like that may happen much slower than usual.

@sigurdm
Copy link
Contributor

sigurdm commented Jul 30, 2024

Writing here so I don't open a new issue and create more noise but let me know if you want me to open an issue

I opened dart-lang/dartdoc#3826 to track this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants