Sign inSign up

anandarh/sonar-flutter

By anandarh

•Updated about 6 years ago

Sonarqube with an additional plugin to enable analysis of Dart and Flutter projects.

Image
0

935

anandarh/sonar-flutter repository overview

⁠Features

⁠Prerequisites

  • Flutter SDK
    Install Flutter as explained on the official documentaiton page. Installation instructions⁠

  • Dart
    Dart is downloaded by the Flutter SDK in $FLUTTER_HOME/bin/cache/dart-sdk, however command lines are not on the path by default (dartanalyzer must be on the path).
    It is recommanded to install Dart SDK separately as explained here : Install the Dart SDK⁠ for more reliability in a CI/CD environement.

  • Sonar Scanner
    Install sonar-scanner as explained in the official documentation. Installation instructions⁠

⁠Project configuration

Create a sonar-project.properties file in the root of your flutter / dart project folder with these contents:

# Must be unique in a given SonarQube instance
sonar.projectKey=pikobar_flutter
sonar.projectName=pikobar_flutter
sonar.projectVersion=2.3.0
 
# default SonarQube server
#sonar.host.url=http://localhost:9000
 
# login or authentication token of a SonarQube user
#sonar.login=48v1uzel1jvqes9xkvlxp9pejo68chz4spm9txc6
 
# path is relative to the sonar-project.properties file. Defaults to
sonar.sources=lib
sonar.tests=test
 
# encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
 
# exclude spec files for coverage tests
#sonar.exclusions=lib/test

For a complete list of available options, please refer to the SonarQube documentation⁠.

⁠Run code analysis

# Run the analysis and publish to the SonarQube server
sonar-scanner

Tag summary

Content type

Image

Digest

Size

302.5 MB

Last updated

about 6 years ago

docker pull anandarh/sonar-flutter