sfoccount lấy cảm hứng từ sloccount

Lá lốt – Hình minh họa

sfoccount is source files of code count.

sfoccount dùng để đếm tổng số file của từng ngôn ngữ lập trình rồi tính tỉ lệ của chúng trong tổng số file của các ngôn ngữ lập trình.

sfoccount viết bằng bash shell trên Linux.

./sfoccount.sh linux-6.6.10

Tiếng Việt
Tổng số file của thư mục chứa mã nguồn:  81704
Tổng số file của các ngôn ngữ lập trình: 62378 file(s) - 76.346300%

English
Total                       files: 81704
Total programming languages files: 62378 file(s) - 76.346300%

Assembly:           1344 file(s) - 2.154600%
AWK:                10 file(s) - .016000%
Bash:               834 file(s) - 1.337000%
C:                  59857 file(s) - 95.958500%
C++:                5 file(s) - .008000%
lex/flex:           10 file(s) - .016000%
Objective-C:        1 file(s) - .001600%
Perl:               57 file(s) - .091300%
Python:             188 file(s) - .301300%
Ruby:               1 file(s) - .001600%
Rust:               60 file(s) - .096100%
sed:                1 file(s) - .001600%
Yacc/Bison:         10 file(s) - .016000%

sfoccount lấy cảm hứng từ sloccount cũng có chức năng như vậy và nhiều hơn viết bằng ngôn ngữ lập trình C.

sloccount --filecount linux-6.6.10
Have a non-directory at the top, so creating directory top_dir
Adding /root/linux-6.6.10/COPYING to top_dir
Adding /root/linux-6.6.10/CREDITS to top_dir
Creating filelist for Documentation
Adding /root/linux-6.6.10/Kbuild to top_dir
Adding /root/linux-6.6.10/Kconfig to top_dir
Creating filelist for LICENSES
Adding /root/linux-6.6.10/MAINTAINERS to top_dir
Adding /root/linux-6.6.10/Makefile to top_dir
Adding /root/linux-6.6.10/README to top_dir
Creating filelist for arch
Creating filelist for block
Creating filelist for certs
Creating filelist for crypto
Creating filelist for drivers
Creating filelist for fs
Creating filelist for include
Creating filelist for init
Creating filelist for io_uring
Creating filelist for ipc
Creating filelist for kernel
Creating filelist for lib
Creating filelist for mm
Creating filelist for net
Creating filelist for rust
Creating filelist for samples
Creating filelist for scripts
Creating filelist for security
Creating filelist for sound
Creating filelist for tools
Creating filelist for usr
Creating filelist for virt
Categorizing files.
Finding a working MD5 command....
Found a working MD5 command.
Warning: in tools, number of duplicates=106
Computing results.


#Files	Directory	    #Files-by-Language (Sorted)
29333   drivers         ansic=29299,asm=15,python=6,perl=5,sh=4,lex=2,yacc=2
10594   arch            ansic=9274,asm=1258,sh=43,perl=10,awk=7,python=1,
                        sed=1
5980    include         ansic=5978,cpp=2
4629    tools           ansic=3524,sh=887,python=124,asm=61,perl=15,cpp=6,
                        yacc=5,lex=5,ruby=1,awk=1
2472    sound           ansic=2472
1949    fs              ansic=1949
1778    net             ansic=1777,asm=1
515     lib             ansic=512,perl=1,awk=1,asm=1
514     kernel          ansic=513,sh=1
263     scripts         ansic=87,sh=79,python=51,perl=31,cpp=6,yacc=3,lex=3,
                        awk=2,asm=1
214     security        ansic=214
202     samples         ansic=181,sh=21
174     mm              ansic=174
169     crypto          ansic=169
96      block           ansic=96
55      io_uring        ansic=55
36      Documentation   python=15,sh=11,perl=5,ansic=4,awk=1
14      virt            ansic=14
12      init            ansic=11,sh=1
12      ipc             ansic=12
8       certs           ansic=5,asm=2,awk=1
6       usr             ansic=3,sh=1,asm=1,perl=1
4       rust            ansic=4
0       LICENSES        (none)
0       top_dir         (none)


Totals grouped by language (dominant language first):
ansic:        56327 (95.42%)
asm:           1340 (2.27%)
sh:            1048 (1.78%)
python:         197 (0.33%)
perl:            68 (0.12%)
cpp:             14 (0.02%)
awk:             13 (0.02%)
lex:             10 (0.02%)
yacc:            10 (0.02%)
sed:              1 (0.00%)
ruby:             1 (0.00%)

Total Number of Files = 59029
Total Number of Source Code Files = 59029
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."

sfoccount và sloccount đều dựa vào đuôi file hay phần mở rộng của file (file extension) để xác định loại file chứa mã nguồn (source code) của một ngôn ngữ lập trình.

Mã nguồn của sfoccount để ở github.

https://github.com/devsecops-edu-vn/sfoccount