# Dart

## Language-specific properties <a href="#language-specific-properties" id="language-specific-properties"></a>

You can discover and update Dart-specific [analysis-parameters](https://docs.sonarsource.com/sonarqube-server/2025.1/analyzing-source-code/analysis-parameters "mention") in the project **Administration** > **Configuration** > **General Settings** > **Languages** > **Dart**

## Preparing the analysis <a href="#preparing-the-analysis" id="preparing-the-analysis"></a>

Before performing the analysis, we highly recommend:

* retrieving all project dependencies declared in `pubspec.yaml`, for example, by\`\`running `flutter pub get` for Flutter projects, `dart pub get` for Dart projects, etc.
* performing a full and successful build of your Flutter or Dart project

Otherwise, you might get incomplete and potentially incorrect analysis results. Running `flutter pub get` or `dart pub get` alone may not be enough to produce a correct analysis, for example, when you analyze generated code.

## Analyzing generated code <a href="#analyzing-generated-code" id="analyzing-generated-code"></a>

When code generation is done via [automated source code generation](https://github.com/dart-lang/source_gen), the analysis of generated code can only happen after the execution of `source_gen`, which requires a full build of the Flutter or Dart project containing the builders.

When code generation is done via lower-level packages such as [build](https://pub.dev/packages/build), the analysis should only happen once the source has been generated and persisted on disk.

{% hint style="warning" %}
Sonar provides the [`sonarqube-scan-action` action](https://github.com/marketplace/actions/official-sonarqube-scan) to ease the configuration of the analysis in GitHub.

However, up to `v3`, the GitHub Action runs the analysis in a Docker container, which has only access to the directory where the project is checked out.

That means that the action doesn’t have access to the directory where dependencies have been retrieved, after running `flutter pub get`, `dart pub get`, or a similar command, which may result in an incomplete and potentially incorrect analysis.

We suggest either using `v6` or above, which is based on a [composite action](https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-composite-action) instead, or [sonarscanner](https://docs.sonarsource.com/sonarqube-server/2025.1/analyzing-source-code/scanners/sonarscanner "mention") directly (see the "Running SonarScanner CLI from the zip file" section).
{% endhint %}

## Related pages <a href="#related-pages" id="related-pages"></a>

* [dart-test-coverage](https://docs.sonarsource.com/sonarqube-server/2025.1/analyzing-source-code/test-coverage/dart-test-coverage "mention")
