Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any good tools to collect Objective-C metrics?

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.

like image 825
Jens Kohl Avatar asked Dec 08 '11 10:12

Jens Kohl


2 Answers

OCLint?

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 ...
like image 184
MdaG Avatar answered Nov 11 '22 16:11

MdaG


Lizard will do it. Check it out at https://github.com/terryyin/lizard.

like image 5
Phil Avatar answered Nov 11 '22 15:11

Phil