How to count your own code? Here are two ways to do this:
First, Cloc
1, first, install homebrew, have installed please skip.
Open Terminal Tools terminal and enter the following commands. The process will let you press the return key and enter the Mac desktop password, follow the prompts to do the following:
" $ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install) "
It is important to note that the Ruturn key is the ENTER key
2, download and install Cloc using homebrew.
Continue to enter in terminal:
Brew Install Cloc
3. Basic usage:
Count the current folder code lines (CD to destination directory first):
Cloc./
Exclude the code of a folder in the current directory, it is more common to exclude the code in pods, because half of pods is a third-party library, so here is the Pods folder as an example:
Cloc./--exclude-dir=pods
The statistical results are clear and extremely fast:
4. Advanced Usage
What should we do if we want to exclude more folders? Each person's memory ability is limited, want to know more usage the best way is to look at the cloc of the use of documents, in the terminal input:
Cloc--help
The results appear in several pages of instructions, according to the keyword we find the exclude option, which is described here:
This is simple, so we knock out the following command to achieve our goal:
Cloc./--exclude-dir=pods,wujiecaojoketest
In addition, based on the documentation, we can also filter out specific suffixes (EXT) and so on.
The above is the simple and practical cloc, reference from Cloc
Second, Pprows
This is a more intuitive interface software, https://github.com/jkpang/PPRows download installation can be used, the use of the project folder to be counted into the software, in the settings can change the ignored files
Requirements Requirements
Dynamic graphs:
Reference from: Jkpang
Line of Code statistics (MAC)