Analyzing Objective-C: the World of OS X and iOS within your Grasp
With version 3.0 of the C / C++ plugin in August, 2014, support of the Objective-C language arrived.
Support of Objective-C in SonarQube was heavily awaited by the community, and has been in our dreams and plans for more than one year. You might wonder - why did it take us so long? And why now, when Apple has announced Swift? Why as a part of the existing plugin? I'll try to shed light on those questions.
A year ago, there were only two developers in SonarSource’s language team, Dinesh Bolkensteyn and me. We’re both heavy hitters, but with more than a dozen language plugins, we weren’t able to give most of them, including C / C++, as much time as we wanted. Also we had technological troubles with analysis of C / C++. As you may know, source code in C / C++ is hard to parse, because... well, it’s a long story, which deserves a separate blog entry, so just take my word for it, it’s hard. And we didn't want to provide a quick-win solution by locking ourselves and our users in to third-party tools, which wouldn't play well in the long-term for the same reasons that third-party tools were a problem in other languages.
Today all that has changed. There are now seven developers on the language team (and room for more), with two dedicated to C / C++. We've spent the year not only on the growth of the team, but also on massive improvements to the entire C / C++ technology stack, while preserving its ease of use. At the same time, we’ve delivered eight new releases, with valuable new rules in each release. Since March, we’ve released about once a month, and plan to keep it up.
With solid new technical foundations in place, we were able to dream again about new horizons. One of them was Objective-C. It’s a strict superset of C in terms of syntax, so the work we had done improving the plugin also prepared us to cover Objective-C. Of course, with the announcement of Swift, actually covering Objective-C may not make sense to some, but there’s a lot of Objective-C code already out there, and as history has shown, old programming languages never die.
That’s why we decided to extend the existing plugin to cover Objective-C, and rebrand the plugin "C / C++ / Objective-C", which is exactly what you see in SonarQube Update Center. Still, to better target the needs of the audiences we decided to have two separated licences: one for C / C++ and one for Objective-C.
And of course this means that out of the box, you get more than 100 Objective-C rules starting straight from the first version, as well as a build-wrapper to simplify analysis configuration. However, during implementation we also realized how unlike C Objective-C is, and for that reason we plan to add new rules targeting specifically Objective-C in the upcoming releases.
So don't wait any longer, and put your software to the quality analysis!