{"id":50932424,"url":"https://github.com/green-code-initiative/creedengo-flutter-mobile","last_synced_at":"2026-06-17T05:31:40.138Z","repository":{"id":359094564,"uuid":"775999543","full_name":"green-code-initiative/creedengo-flutter-mobile","owner":"green-code-initiative","description":"Reduce the environmental footprint of your Flutter-based mobile apps with SonarQube","archived":false,"fork":false,"pushed_at":"2026-05-20T10:22:36.000Z","size":166,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-05-20T14:41:36.164Z","etag":null,"topics":["android","ecodesign","ios","sonarqube","sonarqube-plugin"],"latest_commit_sha":null,"homepage":"https://green-code-initiative.org/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/green-code-initiative.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-22T13:29:42.000Z","updated_at":"2026-05-20T10:22:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/green-code-initiative/creedengo-flutter-mobile","commit_stats":null,"previous_names":["green-code-initiative/creedengo-flutter-mobile"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/green-code-initiative/creedengo-flutter-mobile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-code-initiative%2Fcreedengo-flutter-mobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-code-initiative%2Fcreedengo-flutter-mobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-code-initiative%2Fcreedengo-flutter-mobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-code-initiative%2Fcreedengo-flutter-mobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/green-code-initiative","download_url":"https://codeload.github.com/green-code-initiative/creedengo-flutter-mobile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-code-initiative%2Fcreedengo-flutter-mobile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34435978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["android","ecodesign","ios","sonarqube","sonarqube-plugin"],"created_at":"2026-06-17T05:31:34.598Z","updated_at":"2026-06-17T05:31:40.132Z","avatar_url":"https://github.com/green-code-initiative.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creedengo Flutter Plugin\n\n[![Build Status](https://github.com/creedengo/creedengo-flutter/actions/workflows/ci.yml/badge.svg)](https://github.com/creedengo/creedengo-flutter/actions)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL_v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![SonarQube](https://img.shields.io/badge/SonarQube-9.4%2B-orange)](https://www.sonarqube.org/)\n[![Java](https://img.shields.io/badge/Java-11%2B-red)](https://adoptium.net/)\n\nA SonarQube plugin that surfaces eco-design issues in Flutter and Dart codebases. It implements a subset of the [Creedengo / Green Code Initiative](https://github.com/green-code-initiative/creedengo-rules-specifications) specifications, adapted to the specifics of mobile and Flutter development.\n\n\u003e **Status:** experimental. Detection is currently regex-based; an AST-based analyzer using the [Dart analyzer](https://pub.dev/packages/analyzer) is on the roadmap (see [Limitations](#limitations)).\n\n## Table of contents\n\n- [Features](#features)\n- [Rules](#rules)\n- [Quick start (Docker)](#quick-start-docker)\n- [Manual installation](#manual-installation)\n- [Configuring an analysis](#configuring-an-analysis)\n- [Building from source](#building-from-source)\n- [Project structure](#project-structure)\n- [Limitations](#limitations)\n- [Compatibility](#compatibility)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- Registers `dart` as a SonarQube language (extensions: `.dart`)\n- 15 rules grouped by CNUMR mobile categories: leakage, bottleneck, optimized API, user interface\n- Built-in quality profile activating all Creedengo Flutter rules by default\n- Sensor that scans `.dart` files line by line and creates issues against the dedicated repository\n- Reuses the standard Creedengo / Green Code Initiative `GCI*` identifiers when applicable\n\n## Rules\n\nAll rules are exposed under the SonarQube repository key `creedengo-dart`.\n\n### Leakage — resource leaks\n\n| Key    | Name                  | Severity | Source                                                                                                              |\n| ------ | --------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |\n| GCI79  | Free resources        | Critical | [Creedengo](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI79) |\n| GCI530 | Torch free            | Critical | [Creedengo](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI530) |\n| GCI534 | Camera resource leaks | Critical | Flutter-specific extension                                                                                          |\n\n### Bottleneck — inefficient operations\n\n| Key    | Name                       | Severity | Source                                                                                                              |\n| ------ | -------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |\n| GCI3   | Collection size in loop    | Minor    | [Creedengo](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI3)  |\n| GCI72  | SQL query in loop          | Major    | [Creedengo](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI72) |\n| GCI535 | Network requests in a loop | Major    | Flutter-specific extension                                                                                          |\n\n### Optimized API — adapted APIs\n\n| Key    | Name                        | Severity | Source                                                                                                              |\n| ------ | --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |\n| GCI201 | Avoid unnecessary rebuilds  | Major    | Flutter-specific extension                                                                                          |\n| GCI202 | Use `ListView.builder`      | Major    | Flutter-specific extension                                                                                          |\n| GCI523 | Thrifty geolocation         | Major    | [Creedengo](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI523) |\n| GCI532 | Optimize network usage      | Major    | Flutter-specific extension                                                                                          |\n\n### User Interface — UI optimizations\n\n| Key    | Name                          | Severity | Source                                                                                                              |\n| ------ | ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |\n| GCI31  | Lighter image formats         | Major    | [Creedengo](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI31) |\n| GCI203 | Avoid high-frequency timers   | Major    | Flutter-specific extension                                                                                          |\n| GCI522 | Brightness override           | Major    | [Creedengo](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI522) |\n| GCI531 | Avoid excessive animations    | Major    | Flutter-specific extension                                                                                          |\n| GCI536 | Keep screen on                | Major    | Flutter-specific extension                                                                                          |\n\n\u003e Identifiers prefixed `GCI` that do not yet exist upstream are tracked as Flutter-specific extensions and may be proposed back to the [Creedengo specifications repository](https://github.com/green-code-initiative/creedengo-rules-specifications).\n\n## Quick start (Docker)\n\nThe repository ships a `docker-compose.yml` that provisions PostgreSQL, SonarQube and mounts the freshly built plugin JAR.\n\n```bash\n# 1. Build the plugin JAR (drops it in target/)\nmvn clean package\n\n# 2. Start SonarQube + PostgreSQL with the plugin mounted\ndocker compose up -d sonarqube-db sonarqube\n\n# 3. Wait until http://localhost:9000 reports status UP, then log in (admin/admin)\n./scripts/verify-plugin.sh\n\n# 4. Run an analysis on the bundled sample project\n./scripts/run-analysis.sh\n```\n\nThe bundled `flutter-test-project/` contains intentionally non-compliant Dart snippets so you can validate that issues are reported in SonarQube.\n\nTo tear everything down (containers, volumes):\n\n```bash\n./scripts/cleanup.sh\n```\n\n## Manual installation\n\nIf you already run a SonarQube instance:\n\n1. Build the JAR: `mvn clean package`.\n2. Copy `target/creedengo-flutter-1.0.0-SNAPSHOT.jar` into `$SONARQUBE_HOME/extensions/plugins/`.\n3. Restart SonarQube.\n4. Open *Rules* and filter by repository `Creedengo Dart Rules` to confirm the plugin is loaded.\n\n## Configuring an analysis\n\nAdd a `sonar-project.properties` file at the root of your Flutter project:\n\n```properties\nsonar.projectKey=my-flutter-app\nsonar.projectName=My Flutter App\nsonar.projectVersion=1.0.0\n\nsonar.sources=lib\nsonar.tests=test\nsonar.sourceEncoding=UTF-8\n\n# Optional: skip generated files\nsonar.exclusions=**/*.g.dart,**/*.freezed.dart\n```\n\nThen run the SonarScanner pointing at your SonarQube instance:\n\n```bash\nsonar-scanner \\\n  -Dsonar.host.url=http://localhost:9000 \\\n  -Dsonar.login=\u003ctoken\u003e\n```\n\nThe plugin only contributes Creedengo rules. Test reports, coverage and other Dart-related metrics are not produced by this plugin and need a complementary tool if you want them in SonarQube.\n\n## Building from source\n\nRequirements:\n\n- JDK 11 or newer\n- Maven 3.6 or newer\n\n```bash\n# Compile, run unit tests, package the plugin\nmvn clean verify\n\n# Build only (skip tests)\nmvn clean package -DskipTests\n\n# Run a single test class\nmvn -Dtest=RuleManagerTest test\n```\n\nA coverage report is produced by JaCoCo at `target/site/jacoco/index.html`.\n\n## Project structure\n\n```\n.\n├── src/\n│   ├── main/java/io/creedengo/flutter/\n│   │   ├── CreedengoDartPlugin.java          # plugin entry point\n│   │   ├── DartLanguage.java                # registers the dart language\n│   │   ├── CreedengoDartRulesDefinition.java # rule catalogue\n│   │   ├── CreedengoDartQualityProfile.java  # default quality profile\n│   │   ├── CreedengoDartSensor.java          # file scanner\n│   │   └── rules/                           # one package per CNUMR category\n│   │       ├── leakage/\n│   │       ├── bottleneck/\n│   │       ├── optimizedapi/\n│   │       └── userinterface/\n│   └── test/java/                           # unit tests mirroring the package layout\n├── flutter-test-project/                    # sample Dart code with intentional violations\n├── scripts/                                 # helper shell scripts (Docker-based test loop)\n├── docker-compose.yml\n├── Dockerfile.sonarqube\n└── pom.xml\n```\n\n## Limitations\n\n- Detection is **regex-based**. False positives and false negatives are expected, especially on multi-line constructs or when violations span several files. Do not rely on the plugin for safety-critical reviews.\n- The Dart language registration is minimal: the plugin does not parse Dart code into an AST, does not provide syntax highlighting, and does not compute Dart-specific metrics (lines of code per type, cognitive complexity, etc.).\n- The plugin does not import test or coverage reports. Pair it with another tool if you need those.\n- Tested against SonarQube 9.4 LTS and 10.3 Community. Other versions may work but are not part of the CI matrix yet.\n\n## Compatibility\n\n| Plugin version | SonarQube           | Java |\n| -------------- | ------------------- | ---- |\n| 1.0.x          | 9.4 LTS – 10.3 CE   | 11+  |\n\n## Contributing\n\nBug reports and pull requests are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening an issue or PR. By contributing you agree that your contributions are licensed under the same terms as the project (GPL-3.0).\n\n## License\n\nThis project is licensed under the [GNU General Public License v3.0](LICENSE).\n\n## Acknowledgements\n\n- The [Green Code Initiative](https://github.com/green-code-initiative) for the Creedengo specifications.\n- The [CNUMR mobile best practices](https://github.com/cnumr/best-practices-mobile) catalogue, which inspired the rule categorization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-code-initiative%2Fcreedengo-flutter-mobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreen-code-initiative%2Fcreedengo-flutter-mobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-code-initiative%2Fcreedengo-flutter-mobile/lists"}