有没有什么好的工具可以收集 Objective-C 指标?

发布于 2024-12-20 05:05:03 字数 213 浏览 4 评论 0 原文

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

々眼睛长脚气 2024-12-27 05:05:03

OCLint

来自 oclint.org:

OCLint 是一个静态代码分析工具,用于提高质量和
通过检查 C、C++ 和 Objective-C 代码并查找来减少缺陷
对于潜在的问题,例如:

  • 可能的错误 - 空 if/else/try/catch/finally 语句
  • 未使用的代码
    未使用的局部变量和参数
  • 代码复杂 - 高圈复杂度、NPath 复杂度和高 NCSS
  • 冗余代码 -
    多余的 if 语句和无用的括号
  • 代码异味 - 长
    方法和长参数列表
  • 不良做法 - 颠倒逻辑和
    参数重新分配...

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 ...
盗梦空间 2024-12-27 05:05:03

蜥蜴会做到的。请访问 https://github.com/terryyin/lizard 查看。

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

一抹苦笑 2024-12-27 05:05:03

您可以尝试 XClarify,这是一个相当完整的 Objective-C 代码分析器,而且它是免费的 开源贡献者

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

柠栀 2024-12-27 05:05:03

除了代码行和测试覆盖范围之外,我不确定 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 :)

毁梦 2024-12-27 05:05:03

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

夏末 2024-12-27 05:05:03

我使用很少的工具来收集代码质量指标:

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/

遗忘曾经 2024-12-27 05:05:03

我真正想要计算的是方法、类

nnnot rrreallly....你可以解析xcode索引或nm的输出——或者运行doxygen。

调用其他类等

gcov——或者运行 doxygen

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

那一片橙海, 2024-12-27 05:05:03

我刚刚偶然发现了 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文