I was looking for the same and stumbled over this question, but the accepted answer is only for LOC, not for LLOC, and ProjectCodeMeter seems to be a bit overkill.
What I found as a working solution for me: phploc by Sebastian Bergmann. Works like a charm.
发布评论
评论(4)
我还没有找到在 netbeans 中(在任何操作系统上)执行此操作的方法,但我想您可以使用如下所示的方法:
将这个小脚本保存在您可以找到它的地方:(让我们说“cntln.php”)
并在命令行(cmd.exe)上使用它:
c:>
php -q cntln.php "C:\projects\foo" "~\.php$~"
通过一些小技巧,我确信您可以创建一个快捷方式,然后将其放在快速启动栏或在其他工具中使用它。
自从我刚刚输入以来可能有错误,主要是在 SO 文本框中。
I haven't found a way to do that in netbeans (on any OS) but i guess you could get away with something like the following:
Save this little script someplace where you can find it: (lets say "cntln.php")
and use it on the commandline (cmd.exe):
c:>
php -q cntln.php "C:\projects\foo" "~\.php$~"
With some minor trickery I'm sure you can create a shortcut to it that you can put on the quick launch bar or use it in some other tooling.
Might have bugs since I typed it just now, mostly in the SO text box.
我一直在寻找相同的内容并偶然发现了这个问题,但接受的答案仅适用于 LOC,不适用于 LLOC,而 ProjectCodeMeter 似乎有点矫枉过正。
我发现对我来说可行的解决方案是:Sebastian Bergmann 的phploc。就像魅力一样。
I was looking for the same and stumbled over this question, but the accepted answer is only for LOC, not for LLOC, and ProjectCodeMeter seems to be a bit overkill.
What I found as a working solution for me: phploc by Sebastian Bergmann. Works like a charm.
您可以使用 ProjectCodeMeter 来计算任何 php 项目上的逻辑代码行 (LLOC)(它可以识别注释和空行)
you can use ProjectCodeMeter to count logical lines of code (LLOC) on any php project (it is aware of comments and empty lines)
您可以使用 PDepend 或 PHPMetrics。两者都是免费的开源项目
You can use PDepend or PHPMetrics. Both are free, open source projects