{"id":20664036,"url":"https://github.com/flutterando/flutterando_metrics","last_synced_at":"2025-04-19T16:12:45.741Z","repository":{"id":197003846,"uuid":"697797779","full_name":"Flutterando/flutterando_metrics","owner":"Flutterando","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-18T12:54:10.000Z","size":13168,"stargazers_count":16,"open_issues_count":4,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T09:51:18.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://flutterando.github.io/flutterando_metrics/","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Flutterando.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-28T13:51:58.000Z","updated_at":"2024-11-01T08:09:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7d731e4-7ec1-42ae-b374-a89fecad360e","html_url":"https://github.com/Flutterando/flutterando_metrics","commit_stats":null,"previous_names":["flutterando/flutterando_metrics"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutterando%2Fflutterando_metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutterando%2Fflutterando_metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutterando%2Fflutterando_metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutterando%2Fflutterando_metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flutterando","download_url":"https://codeload.github.com/Flutterando/flutterando_metrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249734698,"owners_count":21317874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T19:21:47.290Z","updated_at":"2025-04-19T16:12:45.714Z","avatar_url":"https://github.com/Flutterando.png","language":"Dart","readme":"[![Build Status](https://shields.io/github/actions/workflow/status/Flutterando/flutterando_metrics/package_analyze.yaml?logo=github\u0026logoColor=white\u0026branch=master)](https://github.com/Flutterando/flutterando_metrics/)\n[![Coverage Status](https://img.shields.io/codecov/c/github/Flutterando/flutterando_metrics?logo=codecov\u0026logoColor=white)](https://codecov.io/gh/Flutterando/flutterando_metrics/)\n[![Pub Version](https://img.shields.io/pub/v/flutterando_metrics?logo=dart\u0026logoColor=white)](https://pub.dev/packages/flutterando_metrics/)\n[![Dart SDK Version](https://badgen.net/pub/sdk-version/flutterando_metrics)](https://pub.dev/packages/flutterando_metrics/)\n[![License](https://img.shields.io/github/license/Flutterando/flutterando_metrics)](https://github.com/Flutterando/flutterando_metrics/blob/master/LICENSE)\n[![Pub popularity](https://badgen.net/pub/popularity/flutterando_metrics)](https://pub.dev/packages/flutterando_metrics/score)\n[![GitHub popularity](https://img.shields.io/github/stars/Flutterando/flutterando_metrics?logo=github\u0026logoColor=white)](https://github.com/Flutterando/flutterando_metrics/stargazers)\n\n\u003cimg\n  src=\"https://raw.githubusercontent.com/Flutterando/flutterando_metrics/master/assets/logo.svg\"\n  alt=\"Flutterando Metrics logo\"\n  height=\"150\" width=\"150\"\n  align=\"right\"\u003e\n\n# Flutterando Metrics\n\n**Note: you can find [the full documentation on the website](https://metrics.flutterando.com.br/docs/individuals/getting-started/)**\n\n[Configuration](https://metrics.flutterando.com.br/docs/individuals/configuration/) |\n[Metrics](https://metrics.flutterando.com.br/docs/individuals/metrics/) |\n[Anti-patterns](https://metrics.flutterando.com.br/docs/individuals/anti-patterns/)\n\n\n\nFlutterando Metrics is a toolkit that helps you identify and fix problems in your Dart and Flutter code. These problems can range from potential runtime bugs and violations of best practices to styling issues. Flutterando Metrics includes over 70 built-in rules to validate your code against various expectations, and you can customize these rules to fit your specific needs.\n\n- Reports [code metrics](https://metrics.flutterando.com.br/docs/individuals/metrics/)\n- Checks for [anti-patterns](https://metrics.flutterando.com.br/docs/individuals/anti-patterns/)\n- Checks [unused `*.dart` files](https://metrics.flutterando.com.br/docs/individuals/cli/check-unused-files/)\n- Checks [unused l10n](https://metrics.flutterando.com.br/docs/individuals/cli/check-unused-l10n/)\n- Checks [unnecessary nullable parameters](https://metrics.flutterando.com.br/docs/individuals/cli/check-unnecessary-nullable/)\n- Can be used as [CLI](https://metrics.flutterando.com.br/docs/individuals/cli/)\n\n## Links\n\n- See [CHANGELOG.md](./CHANGELOG.md) for major/breaking updates, and [releases](https://github.com/Flutterando/flutterando_metrics/releases) for a detailed version history.\n- To contribute, please read [CONTRIBUTING.md](./CONTRIBUTING.md) first.\n- Please [open an issue](https://github.com/Flutterando/flutterando_metrics/issues/new?assignees=dkrutskikh\u0026labels=question\u0026template=question.md\u0026title=%5BQuestion%5D+) if anything is missing or unclear in this documentation.\n\n## Installation\n\n```sh\n$ dart pub add --dev flutterando_metrics\n\n# or for a Flutter package\n$ flutter pub add --dev flutterando_metrics\n```\n\n## Basic configuration\n\nAdd configuration to `analysis_options.yaml` and reload IDE to allow the analyzer to discover the plugin config.\n\nYou can read more about the configuration [on the website](https://metrics.flutterando.com.br/docs/individuals/configuration/).\n\n\n\n### Basic config\n\n```yaml title=\"analysis_options.yaml\"\nanalyzer:\n  plugins:\n    - flutterando_metrics\n\nflutterando_metrics:\n  metrics:\n    cyclomatic-complexity: 20\n    number-of-parameters: 4\n    maximum-nesting-level: 5\n  metrics-exclude:\n    - test/**\n\n```\n\n## Usage\n\n### CLI\n\nThe package can be used as CLI and supports multiple commands:\n\n| Command            | Example of use                                            | Short description                                         |\n| ------------------ | --------------------------------------------------------- | --------------------------------------------------------- |\n| analyze            | dart run flutterando_metrics:metrics analyze lib            | Reports code metrics anti-patterns violations. |\n| check-unnecessary-nullable | dart run flutterando_metrics:metrics check-unnecessary-nullable lib | Checks unnecessary nullable parameters in functions, methods, constructors. |\n| check-unused-files | dart run flutterando_metrics:metrics check-unused-files lib | Checks unused \\*.dart files.                              |\n| check-unused-l10n  | dart run flutterando_metrics:metrics check-unused-l10n lib  | Check unused localization in \\*.dart files.               |\n| check-unused-code  | dart run flutterando_metrics:metrics check-unused-code lib  | Checks unused code in \\*.dart files.                      |\n\nFor additional help on any of the commands, enter `dart run flutterando_metrics:metrics help \u003ccommand\u003e`\n\n**Note:** if you're setting up Flutterando Metrics for multi-package repository, check out [this website section](https://metrics.flutterando.com.br/docs/individuals/cli#multi-package-repositories-usage/).\n\n#### Analyze\n\nReports code metrics and anti-patterns violations. To execute the command, run\n\n```sh\n$ dart run flutterando_metrics:metrics analyze lib\n\n# or for a Flutter package\n$ flutter pub run flutterando_metrics:metrics analyze lib\n```\n\nIt will produce a result in one of the format:\n\n- Console\n- GitHub\n- Codeclimate\n- HTML\n- JSON\n\nConsole report example:\n\n![Console report example](https://raw.githubusercontent.com/Flutterando/flutterando_metrics/master/assets/analyze-console-report.png)\n\n#### Check unnecessary nullable parameters\n\nChecks unnecessary nullable parameters in functions, methods, constructors. To execute the command, run\n\n```sh\n$ dart run flutterando_metrics:metrics check-unnecessary-nullable lib\n\n# or for a Flutter package\n$ flutter pub run flutterando_metrics:metrics check-unnecessary-nullable lib\n```\n\nIt will produce a result in one of the format:\n\n- Console\n- JSON\n\nConsole report example:\n\n![Console report example](https://raw.githubusercontent.com/Flutterando/flutterando_metrics/master/assets/unnecessary-nullable-console-report.png)\n\n#### Check unused files\n\nChecks unused `*.dart` files. To execute the command, run\n\n```sh\n$ dart run flutterando_metrics:metrics check-unused-files lib\n\n# or for a Flutter package\n$ flutter pub run flutterando_metrics:metrics check-unused-files lib\n```\n\nIt will produce a result in one of the format:\n\n- Console\n- JSON\n\nConsole report example:\n\n![Console report example](https://raw.githubusercontent.com/Flutterando/flutterando_metrics/master/assets/unused-files-console-report.png)\n\n#### Check unused localization\n\nChecks unused Dart class members, that encapsulates the app’s localized values.\n\nAn example of such class:\n\n```dart\nclass ClassWithLocalization {\n  String get title {\n    return Intl.message(\n      'Hello World',\n      name: 'title',\n      desc: 'Title for the Demo application',\n      locale: localeName,\n    );\n  }\n}\n```\n\nTo execute the command, run\n\n```sh\n$ dart run flutterando_metrics:metrics check-unused-l10n lib\n\n# or for a Flutter package\n$ flutter pub run flutterando_metrics:metrics check-unused-l10n lib\n```\n\nIt will produce a result in one of the format:\n\n- Console\n- JSON\n\nConsole report example:\n\n![Console report example](https://raw.githubusercontent.com/Flutterando/flutterando_metrics/master/assets/unused-l10n-console-report.png)\n\n#### Check unused code\n\nChecks unused code in `*.dart` files. To execute the command, run\n\n```sh\n$ dart run flutterando_metrics:metrics check-unused-code lib\n\n# or for a Flutter package\n$ flutter pub run flutterando_metrics:metrics check-unused-code lib\n```\n\nIt will produce a result in one of the format:\n\n- Console\n- JSON\n\nConsole report example:\n\n![Console report example](https://raw.githubusercontent.com/Flutterando/flutterando_metrics/master/assets/unused-code-console-report.png)\n\n## Troubleshooting\n\nPlease read [the following guide](./TROUBLESHOOTING.md) if the plugin is not working as you'd expect it to work.\n\n## Contributing\n\nIf you are interested in contributing, please check out the [contribution guidelines](https://github.com/Flutterando/flutterando_metrics/blob/master/CONTRIBUTING.md). Feedback and contributions are welcome!\n\n\n## LICENSE\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutterando%2Fflutterando_metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflutterando%2Fflutterando_metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutterando%2Fflutterando_metrics/lists"}