架构师_程序员_码农网

Retrieve password
Register

QQ登录

Just one step to get started

Search
View:1573|Reply: 2
打印 上一主题 下一主题

cloc counts blank lines, comment lines, and physical lines in source code in programming languages

[copy link]
跳转到指定楼层
owner
发表于 2023-2-23 20:36:42| 看该作者回帖奖励|ReverseBrowse|Read Mode
cloc is a tool for counting lines of source code information against blank, commented and physical lines of source code in many programming languages. Given two versions of a code base, cloc can count the difference between blank lines, comment lines, and source lines. It is written entirely in Perl and does not depend on the standard distribution of Perl v5.6 and higher (code from some external modules is embedded in cloc), so it is very portable. As you know, cloc runs on a wide variety of Linux, FreeBSD, NetBSD, OpenBSD, macOS, AIX, HP-UX, Solaris, IRIX, z/OS, and Windows. (To run the Perl source version of cloc on Windows, you need ActiveState Perl 5.6.1 or later, Strawberry Perl, a Windows subsystem for Linux, Cygwin, the MobaXTerm installer Perl plug-in, or a mingw environment and terminal such as the one provided by provided by Git for Windows. Alternatively, you can use the Windows binaries of the cloc generated by PAR::Packer to run on a Windows computer that has neither Perl nor Cygwin).


GitHub address: https: //github.com/AlDanial/cloc
Download: https: //github.com/AlDanial/cloc/releases/latest

Installation via Package Manager

npm install -g cloc # https://www.npmjs.com/package/cloc
sudo apt install cloc # Debian, Ubuntu
sudo yum install cloc # Red Hat, Fedora
sudo dnf install cloc # Fedora 22 or later
sudo pacman -S cloc # Arch
sudo emerge -av dev-util/cloc # Gentoo https://packages.gentoo.org/packages/dev-util/cloc
sudo apk add cloc # Alpine Linux
doas pkg_add cloc # OpenBSD
sudo pkg install cloc # FreeBSD
sudo port install cloc # macOS with MacPorts
brew install cloc # macOS with Homebrew
choco install cloc # Windows with Chocolatey
scoop install cloc # Windows with Scoop

You can add cloc to your environment variables, see the tutorial below:

cmd set permanent environment variable command
h ttps:// www.itsvse.com/thread-9230-1-1.html

Count the amount of code in the current folder



Excluding the amount of code in a folder



Counting lines of code for individual files in a directory


Parameter Options

--diff <set1> <set2> - Counts the code differences between the source files of set1 and set2. The input can be a mix of files and directories.
--git - Forces inputs to be recognized as git targets if they are not first recognized as file or directory names.
--ignore-whitespace - Ignore horizontal whitespace when comparing files with --diff.
---max-file-size=<MB> - Skip files larger than a given amount of MB if they are to be skipped.
--exclude-dir=<dir1>,<dir2> - Exclude the given comma-separated directories.
--exclude-ext=<ext1>,<ext2> - To exclude the given file extensions.
--csv - Export results to CSV file format.
--csv-delimiter=<C> - Use the character <C> as a delimiter.
--out=<file> - Save results to <file> .
--quiet - Disables all informational messages and displays only the final report.
--sql=<file> - Writes the results as create and insert statements, which can be read by database programs such as SQLite.

(end)




Previous: PDF.JS preview pdf file, the Chinese does not show the problem
Next: OData] (a) OData's basic knowledge
Coder.com, only published in the process of practice, encountered technical difficulties, do not mislead others.
sofabed
Posted on 2023-2-23 22:23:01|Only View Author
I'm not sure if I'm going to be able to do that.
The code farmer network, only published in the process of practice, encountered technical difficulties, do not mislead others.
jordan shoes for sale
The Bench!
发表于 2023-2-24 10:33:08| 看该作者
sha ye bu shi
The only thing I've done is to publish the technical problems I've encountered in the course of my practice, and not to mislead others.
You need to log in before you can post back Log in | Register

This version of the integral rules

DISCLAIMER:
All software, programming materials or articles released by the Code Farmer Network are limited to study and research purposes; the above content shall not be used for commercial or illegal purposes, otherwise, all the consequences of the user shall be responsible for their own. This site information from the network, copyright dispute has nothing to do with this site. You must completely remove the above content from your computer within 24 hours of downloading. If you like the program, please support the genuine software, buy registration and get better genuine service. If there is any infringement, please contact us by email to deal with it.

Mail To:help@itsvse.com

QQ| ( ICP备14021824号-2 )|Sitemap

GMT+8, 2024-9-19 05:43

Quick ReplyBack to topBack to list