编译有关项目的历史信息(尤其是 SLOC)
我正在寻找一种工具来帮助我编译给定项目的某些代码指标的历史记录。
该项目存储在一个 Mercurial 存储库中,并且有大约一百个修订。我正在寻找这样的东西:
- 检查每个修订版
- 计算指标并将它们存储在带有修订版标识符的地方,
- 与下一个修订版执行相同的操作
首先,计算 SLOC 就足够了,但分析#也很好 )
我知道这些事情通常由 CI 服务器处理,但是我独自完成这个项目,因此没有费心去设置 CI 服务器(我想使用 TeamCity,但我真的没有 一开始就看不到这样做的好处)。如果我现在设置 CI 服务器,它可以处理这个问题吗?
I am looking for a tool that will help me to compile a history of certain code metrics for a given project.
The project is stored inside a mercurial repository and has about a hundred revisions. I am looking for something that:
- checks out each revision
- computes the metrics and stores them somewhere with an identifier of the revision
- does the same with the next revisions
For a start, counting SLOCs would be sufficient, but it would also be nice to analyze # of Tests,TestCoverage etc.
I know such things are usually handled by a CI Server, however I am solo on this project and thus haven't bothered to set up a CI Server (I'd like to use TeamCity but I really didn't see the benefit of doing so in the beginnig). If I'd set up my CI Server now, could it handle that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据 jitter 的建议,我编写了一个在 cygwin 内运行的小 bash 脚本,使用 sloccount 来计算源代码行数。输出只是转储到文本文件中:
According to jitter's suggestion I have written a small bash script running inside cygwin using sloccount for counting the source lines. The output was simply dumped to a textfile:
您可以编写一个例如 shell 脚本来
或者查看 ohloh ,它现在似乎有 Mercurial 支持。
否则我不知道有任何支持mercurial的SCM统计工具。由于 Mercurial 相对较新(自 2005 年以来),可能需要一些时间才能支持此类“次要用例”。 (提示:也许您自己提供一个 hgstat 库,因为 svn 和 csv 都有)
You could write a e.g. shell script which
Or look into ohloh which seems to have mercurial support by now.
Otherwise I don't know of any SCM statistics tool which supports mercurial. As mercurial is relatively young (since 2005) it might take some time until such "secondary use cases" are supported. (HINT: maybe provide a hgstat library yourself as there are for svn and csv)
如果是我编写软件来执行此类操作,我想我会将项目的指标结果转储到单个文件中,并对其进行修订控制。然后,“历史分析”工具必须提取该一个文件的旧版本,而不是每次都必须提取整个存储库的每个旧副本并重新运行所有测试。
If it were me writing software to do that kind of thing, I think I'd dump metrics results for the project into a single file, and revision control that. Then the "historical analysis" tool would have to pull out old versions of just that one file, rather than having to pull out every old copy of the entire repository and rerun all the tests every time.