GithubHelp home page GithubHelp logo

kuhnroyal / sonar-flutter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from insideapp-oss/sonar-flutter

0.0 1.0 1.0 956 KB

SonarQube plugin for Flutter / Dart

License: Other

Shell 0.07% Java 96.31% Dart 0.43% Groovy 0.86% ANTLR 2.33%

sonar-flutter's Introduction

CI Coverage

SonarQube plugin for Flutter / Dart

A plugin to enable analysis of Dart and Flutter projects into SonarQube.

main.png

Features

Feature Supported
Size YES
Issues YES (dartanalyzer rules)
Tests YES
Coverage YES
Complexity YES
Syntax YES

The plugin is compatible with sonarQube 6.7+.

Download

Checkout the Releases page.

Changelog is available here.

Prerequisites

Flutter SDK

Install Flutter as explained on the official documentation 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 recommended to install Dart SDK separately as explained here : Install the Dart SDK for more reliability in a CI/CD environment.

sonar-scanner (requires Java)

Install sonar-scanner as explained in the official documentation.

Installation instructions

Installation (on the server)

  • Download the plugin binary into the $SONARQUBE_HOME/extensions/plugins directory.
  • Restart the server.

Project configuration

Create a sonar-project.properties file at the root with this content :

# Project identification
sonar.projectKey=flutter_rocks
sonar.projectName=Flutter Rocks
sonar.projectVersion=1.0
	
# Source code location.
# Path is relative to the sonar-project.properties file. Defaults to .
# Use commas to specify more than one folder.
sonar.sources=lib
sonar.tests=test

# Encoding of the source code. Default is default system encoding.
sonar.sourceEncoding=UTF-8

# Allows reuse of an existing analyzer report
# sonar.dart.analysis.reportPath=

# Analyzer mode
# Can be:
# - flutter (flutter analyze) - default
# - dart (dart analyze)
# - legacy (dartanalyzer)
# sonar.flutter.analyzer.mode= 

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

Run analysis

Use the following commands from the root folder to start an analysis:

# Download dependencies 
flutter pub get 
# Run tests with User feedback (in case some test are failing)
flutter test
# Run tests without user feedback regeneration tests.output and coverage/lcov.info
flutter test --machine --coverage > tests.output 

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

Use existing analysis options

The plugin uses its own analysis options file. If analysis_options.yaml file already exists under the project root, it will be saved during the analysis and then restored to its initial state.

To disable this behavior and use the existinganalysis_options.yaml file instead, add the following line to sonar-project.properties file :

# Use existing options to perform dartanalyzer analysis
sonar.dart.analysis.useExistingOptions=true

Contributing

Any help is welcome, and PRs will be greatly appreciated!

License

SonarQube Plugin for Flutter / Dart is released under the GNU LGPL v3 license. See the LICENSE file for more information.

sonar-flutter's People

Contributors

zippy1978 avatar kuhnroyal avatar mreichelt avatar victorgilc avatar stephanecodes avatar dmorawetz avatar franklychilled avatar etiennecadicidean avatar blundell avatar thiagoloureiro avatar sydowma avatar

Watchers

 avatar

Forkers

abhijeetnapses

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.