{"id":19359827,"url":"https://github.com/codacy/codacy-dartanalyzer","last_synced_at":"2026-03-14T22:09:47.010Z","repository":{"id":37084173,"uuid":"447944846","full_name":"codacy/codacy-dartanalyzer","owner":"codacy","description":"Codacy Tool for Dart Analyzer","archived":false,"fork":false,"pushed_at":"2025-10-02T11:17:30.000Z","size":832,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-02-07T21:48:28.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codacy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-14T11:31:37.000Z","updated_at":"2025-10-02T11:12:50.000Z","dependencies_parsed_at":"2024-02-26T19:46:29.989Z","dependency_job_id":"aac3f886-2d32-45db-9a0c-4d20c32ce81f","html_url":"https://github.com/codacy/codacy-dartanalyzer","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/codacy/codacy-dartanalyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-dartanalyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-dartanalyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-dartanalyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-dartanalyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codacy","download_url":"https://codeload.github.com/codacy/codacy-dartanalyzer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-dartanalyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30519259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-14T19:51:21.629Z","status":"ssl_error","status_checked_at":"2026-03-14T19:51:12.959Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10T07:16:16.907Z","updated_at":"2026-03-14T22:09:46.993Z","avatar_url":"https://github.com/codacy.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codacy Dart Analyzer\n\nThis is the docker engine we use at Codacy to have [Dart Analyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer) support.\nYou can also create a docker to integrate the tool and language of your choice!\nSee the [codacy-engine-scala-seed](https://github.com/codacy/codacy-engine-scala-seed) repository for more information.\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c19f9b18251e4dc5bce89b0a70d0bc70)](https://app.codacy.com/gh/codacy/codacy-dartanalyzer?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=codacy/codacy-dartanalyzer\u0026utm_campaign=Badge_Grade_Settings)\n[![Build Status](https://circleci.com/gh/codacy/codacy-dartanalyzer.svg?style=svg)](https://circleci.com/gh/codacy/codacy-dartanalyzer)\n\n## Supported packages lints on analysis_config.yaml files\n\n*   [lints](https://pub.dev/packages/lints)\n*   [flutter_lints](https://pub.dev/packages/flutter_lints)\n\n### Adding supported packages \n\nTo support new packages just add them on Dockerfile after the development context is created, like so:\n```dockerfile\n  RUN dart pub add \u003cpackage\u003e --dev\n```\n\n## How to bump the tool\n\n-   Update the version at `.tool_version` file with the new SDK version.\n-   Re-run the [doc generation](#how-to-update-the-documentation).\n\n## Implementation Details\n\nWe use `dart analyze` command, which performs static analysis on dart source code. It works by having an `analysis_options.yaml` file, which specifies all the necessary rules for analysis. This file has the following structure:\n```yaml\ninclude: package:lints/recommended.yaml\n\nanalyzer:\n  exclude: [build/**]\n  language:\n    strict-casts: true\n    strict-raw-types: true\n\nlinter:\n  rules:\n    - cancel_subscriptions\n```\n\nThe example above illustrates the most common entries you will have to specify:\n-   The include operation is used to import options from the specified URL. __You can include at most one file.__\n-   The analyzer entry customizes static analysis, where you can activate or de-activate specific rules, ignore files, etc.\n-   The linter entry specifies linting rules.\n\n### Analysis Option File Precedence\nYou can have multiple `analysis_options.yaml` files in a project. However, there are some rules that apply when you do so.\nThe analyzer will always use the first analysis_options file it finds when searching through the file hierarchy. \nThe following image explains the rules used for the options files: \n\n\u003cfigure\u003e\n  \u003cimg src=\"https://dart.dev/assets/img/guides/analysis-options-directory-structure.png\" style=\"background: white\"\u003e\n  \u003cfigcaption\u003eFig.1 - Options files example (taken from the \u003ca href=\"https://dart.dev/guides/language/analysis-options\"\u003eofficial documentation\u003c/a\u003e)\u003c/figcaption\u003e\n\u003c/figure\u003e\n\nIn the case demonstrated above, the analyzer uses file `#1` to analyze the code in `my_other_package` and `my_other_other_package`, and file `#2` to analyze the code in `my_package`.\nThis implies that any `analysis_options.yaml` files specified in the hierarchy will override the users' provided analysis configurations.\n\nWhen building the docker image, we the necessary files required to support the `include` operation on the `analysis_options.yaml` files [supported packages](#supported-packages-lints-on-analysis_configyaml-files).\n\n### Output formatting\nBy default, dart outputs the analysis results in a human-readable format. However, there is an optional argument `format` that makes it easier to parse.\nWe use `--format=machine` to provide the best format for parsing the results by Codacy.\n\n## Usage\n\nYou can create the docker image by executing the following commands:\n\n```bash\nsbt graalvm-native-image:packageBin\ndocker build --build-arg TOOL_VERSION=$(cat .tool_version) -t codacy-dartanalyzer .\n```\n\nTo run the docker image, you can use the following command:\n\n```bash\ndocker run -it -v $srcDir:/src  \u003cDOCKER_NAME\u003e:\u003cDOCKER_VERSION\u003e\n```\n\n## Test\n\nFor a faster development loop, you can create a JVM-based Docker image instead of creating a native-image:\n\n```bash\nsbt universal:stage\ndocker build --build-arg TOOL_VERSION=$(cat .tool_version) -t codacy-dartanalyzer -f Dockerfile.dev .\n```\n\nWe use the [codacy-plugins-test](https://github.com/codacy/codacy-plugins-test) to test our external tools integration.\nYou can follow the instructions there to make sure your tool is working as expected.\n\n## How to update the documentation\n\nTo generate the pattern.json and rules descriptions you must run a dart program from the project root.\n\n```bash\ndart run doc-generator/lib/generatedocs.dart\n```\n---\n\n## What is Codacy?\n\n[Codacy](https://www.codacy.com/) is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.\n\n### Among Codacy’s features:\n\n -   Identify new Static Analysis issues\n -   Commit and Pull Request Analysis with GitHub, BitBucket/Stash, GitLab (and also direct git repositories)\n -   Auto-comments on Commits and Pull Requests\n -   Integrations with Slack, HipChat, Jira, YouTrack\n -   Track issues in Code Style, Security, Error Proneness, Performance, Unused Code and other categories\n\nCodacy also helps keep track of Code Coverage, Code Duplication, and Code Complexity.\n\nCodacy supports PHP, Python, Ruby, Java, JavaScript, Dart, and Scala, among other languages.\n\n### Free for Open Source\n\nCodacy is free for Open Source projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodacy%2Fcodacy-dartanalyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodacy%2Fcodacy-dartanalyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodacy%2Fcodacy-dartanalyzer/lists"}