Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrseanryan/loc-counter
:memo: Counts how many lines of code (LOC/SLOC) are in a code base, by programming language.
https://github.com/mrseanryan/loc-counter
code-analysis code-summarization loc sloc static-analysis
Last synced: 2 months ago
JSON representation
:memo: Counts how many lines of code (LOC/SLOC) are in a code base, by programming language.
- Host: GitHub
- URL: https://github.com/mrseanryan/loc-counter
- Owner: mrseanryan
- License: other
- Created: 2018-12-24T10:24:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T15:26:03.000Z (about 1 year ago)
- Last Synced: 2024-04-18T01:53:38.026Z (9 months ago)
- Topics: code-analysis, code-summarization, loc, sloc, static-analysis
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# :memo: loc (Lines Of Code) counter
Counts how many lines of code (LOC/SLOC)* are in a code base, by programming language.
The programming languages are determined via the file extensions.
\* LOC = Lines Of Code
\* SLOC = Source Lines Of Code## Dependencies
- Python 3.x
## Installation
- Download the [python script](./loc_counter.py) (or download or clone this whole repo)
- Save the script in a suitable location, such as `/scripts`
## Usage
```
cd /my_source_code./scripts/loc_counter.py
```### Example output
```
Type Files Lines
Python 1 377Files Lines
Identified Code 1 377Skipped 2 75
Skipped extensions: mdTotal 3 452
```### Detailed Usage
This script scans the current directory and reports several
statistics of interest to code spelunkers:- total number of directories that contain code
- total number of files in all directories.
- total number of files in each of the following programming
languages:
- SQL, .NET, C#, PowerShell, JavaScript, CSS, SCSS, JSON, ASP.NET, TypeScript.
Also other languages including:
- Awk, C, C++, HTML, IDL, Java, Perl, PHP, Java, Python, TCL, VB6.The programming language is determined via the file extension(s).
The script automatically ignores any file in typical 'not source code' directories, such as `node_modules` or `.git`.
#### options
The -w or --where argument tells the program that for each type of
code it is to list all the directories that contain that type of code.The -e or --exclude argument excludes certain sub-directories from the
search. The exclude argument can be used several times on the same
line like this:The -l or --language option says to only find one language, and not
all of them.The -p or --pretty option allows the user to select HTML or LaTeX
table output format instead of plain text.`
loc_counter.py -e HTML -e DoxyFiles
`## origin
This is an updated version of `what.py` by George V. Neville-Neil.
The original version is here: http://www.codespelunking.org/downloads/what.py
## License
See the [original license](LICENSE) or the same text in the source file.