Use sonar with the Objective-C language definition

I found a blog post that describes how to use CPD in an Objective-C project. The author also provided a CPD language library for ObjectiveC . Unfortunately, the graphical interface provided by the Violations plugin in Jenkins is pretty ugly. The visualizations that Sonar uses are much more useful when analyzing code.

The following command is used to create 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 in Jenkins. But how can I tell Sonar to use the library ObjCLanguage

? I only need this for code duplication detection and sonar rendering (since it is much prettier).

+3


source to share


3 answers


If you want to get analysis results in Sonar, you need to install the Sonar plugin, which supports the language. However, there is currently no plugin for Objective-C, so you won't be a table to get what you are trying to achieve ... unless you develop this plugin! ;-)



+4


source


It seems that work continues on an Objective-C plugin for Sonar. You can find it at https://github.com/fhelg/sonar-objective-c



+2


source


I also saw another Objective-C plugin for Sonar: https://github.com/octo-technology/sonar-objective-c

+2


source







All Articles