Giter Club home page Giter Club logo

code-stats's Introduction

This simple CLI tool will scan path/paths for files and analyze them for some code statistics, like number of files, code rows, comment rows, extensions, etc

Instalation

git clone https://github.com/methlock/code-stats.git
sudo cp code-stats/bin/code-stats /usr/local/bin
rm -r code-stats   

Type code-stats help for description.

Output:

Usage:
  code-stats [command]

Available Commands:
  help        Help about any command
  scan        Scan path or paths for files and process them

Flags:
  -h, --help   help for code-stats

Use "code-stats [command] --help" for more information about a command.

Usage

Type $ code-stats scan -help for usage and flags.

Output:

Scan path or paths for files and process them

Usage:
  code-stats scan [PATH or PATHS] [flags]

Flags:
  -x, --allowed-exts string   Specify the extensions to process. Pass them without dot, like '-x "go py"'
  -e, --exclude-path string   Paths to exclude. Usage: '-e "path1 path2"'
  -h, --help                  help for scan
  -s, --hidden                Search and process also hidden folders and files
  -p, --print-exts            Prints also information by extensions
  -f, --print-files           Prints stats for each file
  -n, --process-no-ext        Process also files with no extensions, like binaries

Example

Example usage on this repository.

code-stats path/to/this/repo -pf

Prints overall info as well as extensions and individual files stats.

Output:

Overall stats:
 Number of files: 7
 Total lines: 450
 Code lines: 416
 Comment lines: 34

Stats by extensions
Extension  Files  Total lines  Code lines  Comment lines
md         1      81           81          0
go         6      369          335         34

Stats by files:
Name       Total lines  Code lines  Comment lines  Path
README.md  81           81          0              .../code-stats/README.md
root.go    26           23          3              .../code-stats/cmd/root.go
scan.go    214          193         21             .../code-stats/cmd/scan.go
config.go  6            5           1              .../code-stats/config/config.go
main.go    29           29          0              .../code-stats/main.go
models.go  54           50          4              .../code-stats/models/models.go
utils.go   40           35          5              .../code-stats/utils/utils.go

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.