Line of Code statistics (MAC)

Source: Internet
Author: User
Tags install homebrew

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
    • Mac OS X 10.11+
    • Xcode 8+

Dynamic graphs:

Reference from: Jkpang

Line of Code statistics (MAC)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.