| Branch | Status |
|---|---|
| master | |
| develop |
This repository is a fork of the open source SonarQube Plugin for Objective-C. It provides modifications and extra features needed for our internal use.
A SonarQube 5.0 dashboard of the iOS open source project GreatReader:
###Features
- Complexity
- Design
- Documentation
- Duplications
- Issues (OCLint: 63 rules, Faux Pas: 102 rules)
- Size
- Tests
###Compatibility
Releases available from this repository are compliant with SonarQube 4.3.x and above.
###Faux Pas support
Faux Pas is a wonderful tool to analyse iOS or Mac applications source code, however it is not free. A 30 trial version is available here.
The plugin runs fine even if Faux Pas is not installed (Faux Pas analysis will be skipped).
###Download
Binary packages will be available soon...
###Prerequisites
- a Mac with Xcode
- SonarQube and SonarQube Runner installed (HomeBrew installed and
brew install sonar-runner) - xcpretty (
gem install xcpretty) - xctool (HomeBrew installed and
brew install xctool). If you are using Xcode 6, make sure to update xctool (brew upgrade xctool) to a version > 0.2.2. - OCLint installed. Version 0.10.1 recommended.
- gcovr installed for legacy (pre Xcode 7 coverage)
- slather with profdata support (see instructions below) for Xcode 7 and above.
- Faux Pas command line tools installed (optional)
###Installation of slather with profdata support
At the time, slather does not support profdata. A special version of slather needs t be installed.
To install slather with profdata support, follow those steps :
git clone https://github.com/mattdelves/slather.git
cd slather
git checkout feature-profdata
gem build slather.gemspec
gem install --both slather-1.8.1.gem
###Code coverage data format
Since Xcode 7, Apple changed its coverage data format to a new format called 'profdata'. By default this format will be used by the plugin, except if you explicitly force it to legacy mode (for Xcode 6 and below) in your sonar-project.properties with this line:
sonar.objectivec.coverageType=legacy
###Installation (once for all your Objective-C projects)
- Download the plugin binary into the $SONARQUBE_HOME/extensions/plugins directory
- Copy run-sonar.sh somewhere in your PATH
- Restart the SonarQube server.
###Configuration (once per project)
- Copy sonar-project.properties in your Xcode project root folder (along your .xcodeproj file)
- Edit the
sonar-project.propertiesfile 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.
###Analysis
- Run the script
run-sonar.shin your Xcode project root folder - Enjoy or file an issue!
###Update (once per plugin update)
- Install the lastest plugin version
- Copy
run-sonar.shsomewhere in your PATH
If you still have run-sonar.sh file in each of your project (not recommended), you will need to update all those files.
###Contributing
Feel free to contribute to this plugin by issuing pull requests to this repository or to the original one.
###License
SonarQube Plugin for Objective-C is released under the GNU LGPL 3 license.