Question

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.

Était-ce utile?

La solution

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 ...

Autres conseils

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

You can try XClarify, a pretty complete objective-c code analyzer, and it's free for open source contributors.

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 :)

ProjectCodeMeter measures flow complexity (similar to McCabe cyclomatic complexity) on Objective-C code, but it doesn't count methods and classes though..

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/

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

I just stumbled upon Xcode Statistician (link seems to be dead), but haven't tried it yet. The zip archive can be downloaded directly.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top