Reputation: 5969
I'm using Jenkins for CI on iOS projects and want to collect some software metrics on them. But the only tool I was able to find was CLOC which only counts lines of codes (LOCs). Nevertheless it's better than nothing.
What I really want to count are methods, classes, calls to other classes etc. (to do the fancy cyclomatic complexity stuff).
Perhaps I'm missing some tools, let me know, if I do.
Upvotes: 11
Views: 4946
Reputation: 5969
I just stumbled upon Xcode Statistician (link seems to be dead), but haven't tried it yet. The zip archive can be downloaded directly.
Upvotes: 0
Reputation: 131
You can try XClarify, a pretty complete objective-c code analyzer, and it's free for open source contributors.
Upvotes: 3
Reputation: 3145
I use few tools for gathering code quality metrics:
I've found recently that it exists free plugin for SonarQube - https://github.com/octo-technology/sonar-objective-c but it's not really feature-rich. Official one is here: http://www.sonarsource.com/products/plugins/languages/objective-c/
Upvotes: 1
Reputation: 1070
Lizard will do it. Check it out at https://github.com/terryyin/lizard.
Upvotes: 5
Reputation: 2730
From oclint.org:
OCLint is a static code analysis tool for improving quality and reducing defects by inspecting C, C++ and Objective-C code and looking for potential problems like:
- Possible bugs - empty if/else/try/catch/finally statements
- Unused code unused local variables and parameters
- Complicated code - high cyclomatic complexity, NPath complexity and high NCSS
- Redundant code - redundant if statement and useless parentheses
- Code smells - long method and long parameter list
- Bad practices - inverted logic and parameter reassignment ...
Upvotes: 9
Reputation: 21
ProjectCodeMeter measures flow complexity (similar to McCabe cyclomatic complexity) on Objective-C code, but it doesn't count methods and classes though..
Upvotes: 2
Reputation: 104698
What I really want to count are methods, classes
nnnot rrreallly.... you can parse the xcode indexes or the output of nm
-- or run doxygen.
calls to other classes etc
gcov
-- or run doxygen
Upvotes: 0
Reputation: 3291
Beyond lines of code and test coverage, I'm not sure there are any such tools yet for Obj-C. I suspect we'll see some soon given the influx of devs from other platforms who use metrics, but in my 7 years as an Obj-C dev I haven't heard of anyone having a tool for collecting them. Of course it'd be good to be proved wrong :)
Upvotes: 2