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).
source to share
It seems that work continues on an Objective-C plugin for Sonar. You can find it at https://github.com/fhelg/sonar-objective-c
source to share
I also saw another Objective-C plugin for Sonar: https://github.com/octo-technology/sonar-objective-c
source to share