https://github.com/yo35/code-stat
Count the number of code lines and comment lines on a set of source code files, and report the result.
https://github.com/yo35/code-stat
Last synced: 10 months ago
JSON representation
Count the number of code lines and comment lines on a set of source code files, and report the result.
- Host: GitHub
- URL: https://github.com/yo35/code-stat
- Owner: yo35
- License: gpl-3.0
- Created: 2023-03-05T14:30:45.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-01T10:24:34.000Z (over 1 year ago)
- Last Synced: 2025-04-02T14:51:45.408Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 96.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Code Stat
=========
Count the number of code lines and comment lines on a set of source code files, and report the result.
[](https://github.com/yo35/code-stat/actions/workflows/main.yml)
Install
-------
Just download [code-stat.py](code-stat.py). No extra package/file/dependency/stuff/... is required.
Usage
-----
```
python3 code-stat.py [ [ ...]]
```
Count the number of source code files passed in argument of the script, and the number of code lines
and comment lines they contain. If a folder is passed in argument of the script, all its content is
analyzed, including recursively the content of its child folders, grandchild folders, etc...
Supported languages
-------------------
Language | File extensions
------------------|----------------
C/C++ | `.c` `.cpp` `.cxx` `.cc` `.h` `.hpp` `.hxx` `.hh`
C# | `.cs`
CSS | `.css`
CUDA | `.cu` `.cuh`
Fortran 90 | `.f90`
Java | `.java`
JavaScript | `.js` `.jsx` `.cjs` `.mjs`
Kotlin | `.kt`
Pascal | `.pas`
PHP | `.php`
Python | `.py`
SQL | `.sql`
TypeScript | `.ts` `.tsx` `.cts` `.mts`
Unix shell script | `.sh` `.bash` `.csh` `.ksh` `.zsh`
Only files having one of the above-mentionned extensions are analyzed.