Java Shell Groovy Swift
Clone or download
Latest commit 21a8581 Aug 13, 2018

Branch Status
master Build Status
develop Build Status

SonarQube Plugin for Swift

This is an open source initiative for Apple Swift language support in SonarQube. The structure of the plugin is based on the sonar-objective-c plugin.

Example iOS SonarQube dashboard

In SonarQube under Quality Profiles the used Linter can be specified by selecting either the SwiftLint Profile or the Tailor Profile as Default profile for Swift Projects:

Set preferred profile (SwiftLint or Tailor) to default in SonarQube.


Feature Supported MacOS Unix
Complexity YES Uses Lizard Uses Lizard
Design NO
Documentation YES
Duplications YES
Issues YES Uses SwiftLint and/or Tailor Uses Tailor
Size YES
Tests YES Uses xcodebuild + xcpretty xcpretty Not Supported
Code coverage YES Uses slather Not Supported


Checkout the Releases page.

The full release history is also available in

Launching an analysis

If you use fastlane, please read our fastlane integration doc. Otherwise, run the script from your Xcode project root folder


Installation of xcpretty with JUnit reports fix

At the time, xcpretty needs to be fixed to work with SonarQube.

To install the fixed version, follow those steps :

git clone
cd xcpretty
git checkout fix/duration_of_failed_tests_workaround
gem build xcpretty.gemspec
sudo gem install --both xcpretty-0.2.2.gem

Installation (once for all your Swift projects)

  • Download the plugin binary into the $SONARQUBE_HOME/extensions/plugins directory
  • Copy somewhere in your PATH
  • Restart the SonarQube server.

Configuration (once per project)

  • Copy in your Xcode project root folder (along your .xcodeproj file)
  • Edit the file to match your Xcode iOS/MacOS project

The good news is that you don't have to modify your Xcode project to enable SonarQube!. Ok, there might be one needed modification if you don't have a specific scheme for your test target, but that's all.

Update (once per plugin update)

  • Install the lastest plugin version
  • Copy somewhere in your PATH

If you still have file in each of your project (not recommended), you will need to update all those files.


Thank you for your interest in the project! Contributions are welcome and appreciated.

Make sure to read these guides before getting started:


SonarQube Plugin for Swift is released under the GNU LGPL v3 license. See the LICENSE file for more info.