0

We are using cloc.pl for analysis purpose. And cloc was proved very useful so far when we were just counting lines of code. But now we are trying to get diff between two branches.

Using the documentation mentioned in the link above, I am trying to get the diff:

    perl cloc.pl --diff branch-1.0/ExampleClass.java branch-2.0/ExampleClass.java

This produces perfect result for a single file and reports modified lines correctly. The same is true for other values like removed, added and so on.

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Java
 same                            0              0            209            294
 modified                        1              0            170             12
 added                           0              0            647              1
 removed                         0              5             64             46
-------------------------------------------------------------------------------
SUM:
 same                            0              0            209            294
 modified                        1              0            170             12
 added                           0              0            647              1
 removed                         0              5             64             46
-------------------------------------------------------------------------------

But now when I’m trying to accomplish same result for complete branch, i.e., all the files under folder, by issuing something like this:

   perl cloc.pl --diff branch-1.0\ branch-2.0\

Now comes the problem.

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Java
same                            0              0              0              0
modified                        0              0              0              0
added                           0            110           2408            789
removed                         1             32            443            352
-------------------------------------------------------------------------------
SUM:
same                            0              0              0              0
modified                        0              0              0              0
added                           0            110           2408            789
removed                         1             32            443            352
-------------------------------------------------------------------------------

As you can see that when I am trying to issue the command at folder level, all modified number of comments shows 0. All we have is added or removed lines of code or files.

Not sure if I am missing something silly or any issue with cloc tool. I am using version 1.56.

4

1 回答 1

0

此问题已在 1.6 版中得到解决。这帮助我继续前进。显然它是 1.56 版的错误。我也开始使用预建的“cloc-1.6.exe”

我在这方面发现的另一件事是,可以在http://sourceforge.net/p/cloc/bugs/上找到更多帮助/支持相关的博客/讨论,这实际上对我的情况有所帮助。

于 2014-07-24T08:20:49.777 回答