Use Sonar with Objective-C language definition
objective-c, sonarqube
Solution
If you want to have analysis results in Sonar, you need to install a Sonar plugin that brings support for the language. However, there's currently no plugin for Objective-C, so you won't be table to get what you're trying to achieve... unless you develop this plugin! ;-)
Problem
I've found a blog post that describes how to use CPD on an Objective-C project. The author also provided a CPD language library for ObjectiveC. Unfortunately, the GUI provided by the Violations plugin in Jenkins is rather ugly. The visualization that Sonar uses is much more helpful in analyzing the code. The following command is used to generate the corresponding CPD output: ``` java -Xmx512m -classpath pmd-4.2.5.jar:ObjCLanguage-0.0.6-SNAPSHOT.jar net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files [Path to XCode project classes] --language ObjectiveC --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > cpd-output.xml ``` As far as I know, the project language can be configured in the Sonar plugin configuration at Jenkins. But how can I tell Sonar to use the `ObjCLanguage` library? I only need this for detecting code duplication and visualization by Sonar (since it is so much prettier).