I've found powershell useful for this.
(我发现powershell对此很有用。)
I consider LoC to be a pretty bogus metric anyway, so I don't believe anything more formal should be required. (我认为LoC无论如何都是一个非常虚假的指标,所以我不相信任何更正式的要求。)
From a smallish solution's directory:
(从一个小的解决方案的目录:)
PS C:Path> (gci -include *.cs,*.xaml -recurse | select-string .).Count
8396
PS C:Path>
That will count the non-blank lines in all the solution's .cs and .xaml files.
(这将计算所有解决方案的.cs和.xaml文件中的非空行。)
For a larger project, I just used a different extension list: (对于更大的项目,我只使用了不同的扩展名列表:)
PS C:Other> (gci -include *.cs,*.cpp,*.h,*.idl,*.asmx -recurse | select-string .).Count
909402
PS C:Other>
Why use an entire app when a single command-line will do it?
(为什么在单个命令行执行时会使用整个应用程序?)
:) (:))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…