我在 iOS 项目上使用 Jenkins 进行 CI,并希望收集一些关于它们的软件指标。但我能找到的唯一工具是 CLOC,它只计算代码行数 (LOC)。尽管如此,总比没有好。
我真正想要计算的是方法、类、对其他类的调用等(做一些花哨的圈复杂度的事情)。
也许我缺少一些工具,如果缺少,请告诉我。
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.
发布评论
评论(8)
OCLint?
来自 oclint.org:
OCLint?
From oclint.org:
蜥蜴会做到的。请访问 https://github.com/terryyin/lizard 查看。
Lizard will do it. Check it out at https://github.com/terryyin/lizard.
您可以尝试 XClarify,这是一个相当完整的 Objective-C 代码分析器,而且它是免费的 开源贡献者。
You can try XClarify, a pretty complete objective-c code analyzer, and it's free for open source contributors.
除了代码行和测试覆盖范围之外,我不确定 Obj-C 是否还有任何此类工具。我怀疑我们很快就会看到一些来自其他平台的使用指标的开发人员的涌入,但在我作为 Obj-C 开发人员的 7 年里,我还没有听说有人拥有收集指标的工具。当然,如果能被证明是错误的那就太好了:)
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 测量 Objective-C 代码上的流程复杂度(类似于 McCabe 圈复杂度),但它不计算方法和虽然上课..
ProjectCodeMeter measures flow complexity (similar to McCabe cyclomatic complexity) on Objective-C code, but it doesn't count methods and classes though..
我使用很少的工具来收集代码质量指标:
I最近发现它存在免费插件SonarQube - https://github.com/octo-technology/sonar-objective-c 但它的功能并不丰富。官方的在这里: http://www.sonarsource.com/products/plugins /语言/objective-c/
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/
nnnot rrreallly....你可以解析xcode索引或
nm
的输出——或者运行doxygen。gcov
——或者运行 doxygennnnot rrreallly.... you can parse the xcode indexes or the output of
nm
-- or run doxygen.gcov
-- or run doxygen我刚刚偶然发现了 Xcode Statistician (链接似乎已失效),但还没有尝试过。可以直接下载 zip 存档。
I just stumbled upon Xcode Statistician (link seems to be dead), but haven't tried it yet. The zip archive can be downloaded directly.