如何衡量源代码统计信息?

时间:2022-04-08 22:15:40

Is there some free tool (preferably command line based) that you can give your root source directory and it will inspect all files and sub-folders and generate a set of nice "statistics"? For example lines of code, number of classes, etc?

是否有一些免费工具(最好是基于命令行),你可以给你的根源目录,它会检查所有文件和子文件夹,并生成一组漂亮的“统计”?例如代码行,类的数量等?

4 个解决方案

#1


17  

I use CLOC (http://cloc.sourceforge.net/). Works great, and supports a ton of languages. Command line based, has a lot of options (exports stats into xml/csv too, so you can programatically dig into the stats easily)

我使用CLOC(http://cloc.sourceforge.net/)。效果很好,支持大量语言。基于命令行,有很多选项(将数据导出到xml / csv中,所以你可以编程方式轻松挖掘统计数据)

#2


8  

Source Monitor from http://www.campwoodsw.com/ will do that and one hell of a lot more. Works with C#. VB.NET, C, C++ and others, either from the command line or its own GUI. It's free & it's great.

来自http://www.campwoodsw.com/的Source Monitor将会做到这一点并且还会有更多。适用于C#。 VB.NET,C,C ++等,可以来自命令行或自己的GUI。它是免费的,它很棒。

#3


0  

G'day,

It doesn't really matter what you use if you're tracking project growth just so long as you are consistent in your measurement approach.

只要您在测量方法上保持一致,只要您跟踪项目增长,那么您使用的内容并不重要。

You could even use a grep for trailing semi-colons as a simple measure of SLOC.

您甚至可以使用grep作为尾随分号,作为SLOC的简单度量。

HTH

cheers,

#4


0  

There's the CodeMetrics Add-In for .NET Reflector; I don't know of a way to run it from the command-line, but it might be possible. Are you wanting to use this in a CI build? It works on assemblies, not source code.

有针对.NET Reflector的CodeMetrics插件;我不知道从命令行运行它的方法,但它可能是可能的。你想在CI版本中使用它吗?它适用于程序集,而不是源代码。

#1


17  

I use CLOC (http://cloc.sourceforge.net/). Works great, and supports a ton of languages. Command line based, has a lot of options (exports stats into xml/csv too, so you can programatically dig into the stats easily)

我使用CLOC(http://cloc.sourceforge.net/)。效果很好,支持大量语言。基于命令行,有很多选项(将数据导出到xml / csv中,所以你可以编程方式轻松挖掘统计数据)

#2


8  

Source Monitor from http://www.campwoodsw.com/ will do that and one hell of a lot more. Works with C#. VB.NET, C, C++ and others, either from the command line or its own GUI. It's free & it's great.

来自http://www.campwoodsw.com/的Source Monitor将会做到这一点并且还会有更多。适用于C#。 VB.NET,C,C ++等,可以来自命令行或自己的GUI。它是免费的,它很棒。

#3


0  

G'day,

It doesn't really matter what you use if you're tracking project growth just so long as you are consistent in your measurement approach.

只要您在测量方法上保持一致,只要您跟踪项目增长,那么您使用的内容并不重要。

You could even use a grep for trailing semi-colons as a simple measure of SLOC.

您甚至可以使用grep作为尾随分号,作为SLOC的简单度量。

HTH

cheers,

#4


0  

There's the CodeMetrics Add-In for .NET Reflector; I don't know of a way to run it from the command-line, but it might be possible. Are you wanting to use this in a CI build? It works on assemblies, not source code.

有针对.NET Reflector的CodeMetrics插件;我不知道从命令行运行它的方法,但它可能是可能的。你想在CI版本中使用它吗?它适用于程序集,而不是源代码。