cloc icon indicating copy to clipboard operation
cloc copied to clipboard

Number of total files mismatch

Open szepeviktor opened this issue 4 years ago • 2 comments

In the README:

prompt> cloc 6be804e07a5db
      48 text files.
      48 unique files.
      15 files ignored.

github.com/AlDanial/cloc v 1.73  T=0.15 s (223.1 files/s, 46159.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                          28           1519            728           4659
YAML                             2              9              2             75
Bourne Shell                     3              6              0             17
make                             1              4              6             10
-------------------------------------------------------------------------------
SUM:                            34           1538            736           4761
-------------------------------------------------------------------------------

48 - 15 = 33 Why does SUM equal 34?

Thank you for your work!

szepeviktor avatar Feb 06 '21 20:02 szepeviktor

Example on my machine:

     382 text files.
     382 unique files.
      17 files ignored.

github.com/AlDanial/cloc v 1.80  T=0.34 s (1076.2 files/s, 75021.1 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                            239           2488           5045          10311
Vuejs Component                 69            280             11           4646
Sass                            24            223             25           1251
JavaScript                      16             50             98            447
Markdown                         7             52              0            160
Blade                            3             19              7            157
YAML                             4             28              2            107
JSON                             3              0              0             82
CSS                              1              2             17              5
-------------------------------------------------------------------------------
SUM:                           366           3142           5205          17166
-------------------------------------------------------------------------------

382 - 17 = 365 SUM = 366

szepeviktor avatar Feb 06 '21 20:02 szepeviktor

Never noticed this before. The difference comes from how zero-sized files are handled. They appear in the ignored list but not in the list of text files leading to a count discrepancy. I'll fix this one day, but not soon.

AlDanial avatar Feb 07 '21 20:02 AlDanial