You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository hosts the Objective-C plugin for [SonarQube](http://www.sonarqube.org/). This plugin enables to analyze and track the quality of iOS (iPhone, iPad) and MacOS developments.
3
+
This repository hosts the Objective-C plugin for
4
+
[SonarQube](http://www.sonarqube.org/). This plugin aims to analyze and track
5
+
the quality of iOS (iPhone, iPad) and MacOS projects, but it can be used with
6
+
other Objective-C projects.
5
7
6
-
This plugin is not supported by SonarSource. SonarSource offers a [commercial SonarSource Objective-C plugin](http://www.sonarsource.com/products/plugins/languages/objective-c/) as well. Both plugins do not offer the same functionalities/support.
8
+
This plugin is not supported by SonarSource. SonarSource offers a
as well. The plugins do not offer the same features/support.
7
11
8
-
The development of this plugin has always been done thanks to the community. If you wish to contribute, check the [Contributing](https://github.com/octo-technology/sonar-objective-c/wiki/Contributing) wiki page.
12
+
The development of this plugin has always been done thanks to the community.
- Use 0.4.x releases for SonarQube >= 4.3 (4.x and 5.x)
40
+
- Use 0.4.0 or later releases for SonarQube >= 4.3 (4.x and 5.x)
41
+
31
42
32
-
###Download
43
+
##Download
33
44
34
45
The latest version is the 0.4.0 and it's available [here](http://bit.ly/18A7OkE).
35
46
The latest SonarQube 3.x release is the 0.3.1, and it's available [here](http://bit.ly/1fSwd5I).
36
47
37
-
You can also download the latest build of the plugin from [Cloudbees](https://rfelden.ci.cloudbees.com/job/sonar-objective-c/lastSuccessfulBuild/artifact/target/).
48
+
You can also download the latest build of the plugin from
- This will parse xcodebuild's output and generate a JUnit XML report
73
+
74
+
75
+
### Coverage
76
+
77
+
Run your tests with code coverage enabled, then run one of the following tools
78
+
to produce a Cobertura XML report which can be imported by this plugin.
79
+
80
+
- With Xcode prior to version 7, use [gcovr](http://gcovr.com) to parse ```*.gcda``` and ```*.gcno``` files
81
+
- With Xcode 7 or greater, use [slather](https://github.com/venmo/slather) to parse the ```Coverage.profdata``` file
82
+
- Note: at time of writing, support for the ```*.profdata``` format has not been released, but can be installed by running ```gem install specific_install && gem specific_install -l https://github.com/viteinfinite/slather.git -b 61f00988e6ad65f817ba81b08533cf78615fff16```
83
+
- Note: at time of writing, xctool is not capable of producing coverage data when using Xcode 7+
84
+
85
+
86
+
### Clang
87
+
88
+
[Clang Static Analyzer](http://clang-analyzer.llvm.org/) can produce Plist
89
+
reports which can be imported by this plugin.
90
+
91
+
There are different ways to produce the reports, such as using Clang's
probably easiest to use xcodebuild's ```analyze``` action. Xcodebuild will
94
+
invoke the analyzer with all the proper arguments and use any additional
95
+
analyzer configuration from your settings under ```*.xcodeproj```. By default,
96
+
it will produce the Plist reports this plugin needs.
97
+
40
98
41
-
###Prerequisites
99
+
###OCLint
42
100
43
-
- a Mac with Xcode...
44
-
-[SonarQube](http://docs.codehaus.org/display/SONAR/Setup+and+Upgrade) and [SonarQube Runner](http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner) installed ([HomeBrew](http://brew.sh) installed and ```brew install sonar-runner```)
45
-
-[xctool](https://github.com/facebook/xctool) ([HomeBrew](http://brew.sh) 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.
46
-
-[OCLint](http://docs.oclint.org/en/dev/intro/installation.html) installed. Version 0.8.1 recommended ([HomeBrew](http://brew.sh) installed and ```brew install https://gist.githubusercontent.com/TonyAnhTran/e1522b93853c5a456b74/raw/157549c7a77261e906fb88bc5606afd8bd727a73/oclint.rb```).
Use it to produce a PMD-formatted XML report that can be imported by this
104
+
plugin.
49
105
50
-
###Installation (once for all your Objective-C projects)
51
-
- Install [the plugin](http://bit.ly/18A7OkE) through the Update Center (of SonarQube) or download it into the $SONARQUBE_HOME/extensions/plugins directory
52
-
- Copy [run-sonar.sh](https://rawgithub.com/octo-technology/sonar-objective-c/master/src/main/shell/run-sonar.sh) somewhere in your PATH
53
-
- Restart the SonarQube server.
54
106
55
-
###Configuration (once per project)
56
-
- Copy [sonar-project.properties](https://rawgithub.com/octo-technology/sonar-objective-c/master/sample/sonar-project.properties) in your Xcode project root folder (along your .xcodeproj file)
57
-
- Edit the *sonar-project.properties* file to match your Xcode iOS/MacOS project
107
+
### Complexity
58
108
59
-
**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.
109
+
Use [Lizard](https://github.com/terryyin/lizard) (```pip install lizard```)
110
+
to produce an XML report that can be imported by this plugin.
60
111
61
-
###Analysis
62
-
- Run the script ```run-sonar.sh``` in your Xcode project root folder
112
+
113
+
## Installation (once for all your Objective-C projects)
114
+
115
+
1. Install [the plugin](http://bit.ly/18A7OkE) through the Update Center (of SonarQube) or download it into the $SONARQUBE_HOME/extensions/plugins directory
116
+
2. Restart the SonarQube server.
117
+
118
+
119
+
## Configuration (once per project)
120
+
121
+
Create a ```sonar-project.properties``` file defining some basic project
122
+
configuration and the location of the reports you want to import.
123
+
124
+
**The good news is that you don't have to modify your Xcode project to enable
125
+
SonarQube!**. Ok, there might be needed modification if you don't have a
126
+
specific scheme for your test target or if coverage is not enabled, but that's all.
127
+
128
+
129
+
## Analysis
130
+
131
+
- Run your build script to produce the various reports
132
+
- Run ```sonar-runner```
63
133
- Enjoy or file an issue!
64
134
65
-
###Update (once per plugin update)
135
+
136
+
## Update
137
+
66
138
- Install the [latest plugin](http://bit.ly/18A7OkE) version
67
-
- Copy [run-sonar.sh](https://rawgithub.com/octo-technology/sonar-objective-c/master/src/main/shell/run-sonar.sh) somewhere in your PATH
139
+
- Check for documented migration steps
140
+
141
+
### Migration to v0.5.x
142
+
143
+
- Analysis property names have changed. Check the sample.
144
+
- Coverage report property no longer supports pattern matching. Only one coverage XML file is supported.
145
+
-```sonar.language``` key changed from ```objc``` to ```objectivec```
146
+
- As a side effect you may have to reconfigure your Quality Profiles
68
147
69
-
If you still have *run-sonar.sh* file in each of your project (not recommended), you will need to update all those files.
70
148
71
-
###Credits
72
-
***Cyril Picat**
73
-
***Gilles Grousset**
74
-
***Denis Bregeon**
75
-
***François Helg**
76
-
***Romain Felden**
77
-
***Mete Balci**
149
+
## Contributors
78
150
79
-
###History
151
+
- Cyril Picat
152
+
- Gilles Grousset
153
+
- Denis Bregeon
154
+
- François Helg
155
+
- Romain Felden
156
+
- Mete Balci
157
+
- Andrés Gil Herrera
158
+
- Matthew DeTullio
159
+
160
+
161
+
## History
162
+
163
+
- v0.5.0 (2015/11): added support for Clang, made properties configurable in SonarQube UI, major refactoring
80
164
- v0.4.1 (2015/05): added support for Lizard to implement complexity metrics.
81
165
- v0.4.0 (2015/01): support for SonarQube >= 4.3 (4.x & 5.x)
82
166
- v0.3.1 (2013/10): fix release
83
167
- v0.3 (2013/10): added support for OCUnit tests and test coverage
84
168
- v0.2 (2013/10): added OCLint checks as SonarQube violations
85
169
- v0.0.1 (2012/09): v0 with basic metrics such as nb lines of code, nb lines of comment, nb of files, duplications
86
170
87
-
###License
88
171
89
-
SonarQube Plugin for Objective C is released under the GNU LGPL 3 license:
172
+
## License
173
+
174
+
SonarQube Plugin for Objective-C is released under the GNU LGPL 3 license:
0 commit comments