Code Monkey home page Code Monkey logo

sonar-objective-c's Introduction

SonarQube Plugin for Objective-C

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.

Features

Feature Supported Details
Complexity YES Uses Lizard
Design NO
Documentation YES
Duplications YES
Issues YES Uses OCLint: 71 rules, and Faux Pas: 102 rules
Size YES
Tests YES Uses xctool, will probably switch to xcodebuild + xcpretty soon
Code coverage YES With gcovr for project before Xcode 7, otherwise slather

Compatibility

Releases available from this repository are compliant with SonarQube 5.6.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 are available in the release section.

Release history

0.6.3 (detached from backelite project)

  • Detached from backelite project (no active maintainers)
  • Ensure compatibility with SonarQube 7.0
  • Update Lizard complexity report parsing to use new API
  • Remove use of deprecated metrics from Lizard complexity reports
  • Warn instead of throwing uncatched exception if Lizard complexity report XML file is not available
  • Ensure OCLint violation reports are properly parsed and sent to SonarQube
  • Update available rules for OCLint
  • Include description from OCLint rules
  • Update Surefire report parsing to use new API

Prerequisites

  • a Mac with Xcode
  • SonarQube and SonarQube Runner installed (HomeBrew installed and brew install sonar-runner)
  • xcpretty (see instructions below)
  • 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.11.0 recommended (0.13.0 since Xcode 9).
  • gcovr installed for legacy (pre Xcode 7 coverage)
  • slather (gem install slather). Version 2.1.0 or above (2.4.4 since Xcode 9).
  • lizard (PIP installed and sudo pip install lizard)
  • Faux Pas command line tools installed (optional)

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 https://github.com/Backelite/xcpretty.git
cd xcpretty
git checkout fix/duration_of_failed_tests_workaround
gem build xcpretty.gemspec
sudo gem install --both xcpretty-0.2.2.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.properties 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.

Analysis

  • Run the script run-sonar.sh in your Xcode project root folder
  • Enjoy or file an issue!

Update (once per plugin update)

  • Install the lastest plugin version
  • Copy run-sonar.sh somewhere 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.

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.