Count the number of code lines and comment lines on a set of source code files, and report the result.
Just download code-stat.py. No extra package/file/dependency/stuff/... is required.
python3 code-stat.py <file-or-folder-1> [<file-or-folder-2> [<file-or-folder-3> ...]]
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...
| 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.