https://github.com/RustyDaemon/source-code-scanner
Scans your project folder and provides a helpful summary: total files number, total lines of code, median, average and other metrics
https://github.com/RustyDaemon/source-code-scanner
code-scanner code-vitals rust stats
Last synced: 3 months ago
JSON representation
Scans your project folder and provides a helpful summary: total files number, total lines of code, median, average and other metrics
- Host: GitHub
- URL: https://github.com/RustyDaemon/source-code-scanner
- Owner: RustyDaemon
- License: mit
- Created: 2024-06-14T19:23:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-26T18:48:27.000Z (over 1 year ago)
- Last Synced: 2025-08-01T00:12:08.038Z (5 months ago)
- Topics: code-scanner, code-vitals, rust, stats
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Source Code Scanner
## Features
- ☑️ Scan a project folder
- ☑️ Search for files with a specific extension(s)
- ☑️ Count the total number of files by extension
- ☑️ Count the total sum of lines of code (ignoring empty lines)
- ☑️ Calculate the average, median, and standard deviation of the lines of code
- ☑️ Ignore specified folder(s)
- ☑️ Generate a tiny markdown report
- ☑️ Colorized output
- ☑️ Written in Rust
## Usage
### Prerequisites
- Rust. Ensure that Rust is installed on your system. You can install Rust from [rust-lang.org](https://rust-lang.org).
### Building the project
Clone the repository and build the project:
```bash
git clone https://github.com/RustamIrzaev/source-code-scanner.git
cd source-code-scanner
cargo build --release # builds the project
cd target/release # switch to where the executable is placed
./source-code-scanner -f -e # run! (see options below)
```
### Run the application
Simple run:
`./source-code-scanner -f -e `
With ignored folders:
`./source-code-scanner -f -e -i ,`
With hardcoded ignored folders:
`./source-code-scanner -f -e --hce`
Real example (with report generation and an extended statistics):
`./source-code-scanner -f /home/user/projects/my_project -e rs -i target,.git -r -s`
## Parameters
### General
- `-f`/`--folder`
- the path to a project folder
- usage `-f `
- `-e`/`--extensions`
- the file extension of the files to be scanned (comma separated)
- usage `-e ,`
- `-i`/`--ignore`
- the list of folders to be ignored, comma separated
- usage `-i ,,`
- `-r`/`--report`: generate a small markdown report (\*.md extension)
- `-s`/`--stats`: show additional summary statistics (average, median, std deviation)
### Misc
- `--hce`: use hardcoded list of ignored folders _(see below)_. Please note that `-i` parameter has higher priority than this one
- `--max-depth`
- the maximum depth of the folder scanning _(default: 10)_
- usage `--max-depth `
- `-V`/`--version`: prints the version of the program
- `-h`/`--help`: prints the help message
## Report
The report is generated in the project folder with the name `report_scs.md`.
The demo report is available [here](demo_report.md).
## Ignored folders
At this moment, the list of ignored folders are hardcoded:
`.idea`, `.git`, `node_modules`, `obj`, `bin`, `build`, `out`, `dist`.
However, you can change this directly from the code - see `hardcoded.rs` file for a `EXCLUDE_FOLDERS_EMBEDDED` slice.
## License
The source code is available under the MIT license. See the [LICENSE](LICENSE) file for more info.