A powerful Python tool to analyze code files and count lines in your project. Instantly identify large files that may be candidates for refactoring.
- π Comprehensive File Support: Supports all major programming languages and file types
- π Beautiful Terminal Output: Rich, colored tables with clear formatting
- π Zero Configuration: Just run and get results immediately
- π Cross-Platform: Works on Windows (PowerShell) and Linux (Bash)
- π Smart Analysis: Identifies refactoring candidates and provides summary statistics
- π― Performance Optimized: Fast scanning even for large codebases
Install via pip:
pip install get-linesNavigate to your project directory and run:
get-linesThat's it! The tool will:
- Scan the current directory and all subdirectories
- Find all code files
- Count lines in each file
- Display a beautiful report sorted by line count (largest first)
- Show refactoring candidates and summary statistics
The tool supports over 80 file extensions including:
- Python:
.py,.pyx,.pyi - JavaScript/TypeScript:
.js,.jsx,.ts,.tsx,.mjs,.cjs - Java:
.java - C/C++:
.c,.cpp,.cc,.cxx,.h,.hpp - C#:
.cs - Go:
.go - Rust:
.rs - PHP:
.php,.php3,.php4,.php5,.phtml - Ruby:
.rb,.rbw - Swift:
.swift - Kotlin:
.kt,.kts - Scala:
.scala,.sc - R:
.r,.R - Shell:
.sh,.bash,.zsh,.fish - Web:
.html,.css,.scss,.sass,.vue,.svelte - Config:
.json,.yaml,.yml,.toml,.xml - And many more...
Code Lines Analysis Report
βββββββββββββββββββββββββββββββββββββββ¬βββββββββ¬ββββββββββββββββββ
β File Path β Lines β Size Indicator β
βββββββββββββββββββββββββββββββββββββββΌβββββββββΌββββββββββββββββββ€
β src/main/java/Application.java β 1,547 β π₯ Large β
β frontend/src/components/Dashboard.jsβ 892 β β οΈ Medium β
β backend/models/user.py β 456 β π Small β
β utils/helpers.js β 123 β π Tiny β
βββββββββββββββββββββββββββββββββββββββ΄βββββββββ΄ββββββββββββββββββ
Summary
Total Files: 47
Total Lines: 12,456
Average Lines per File: 264
Largest File: src/main/java/Application.java (1,547 lines)
π§ Refactoring Candidates (>500 lines):
β’ src/main/java/Application.java (1,547 lines)
β’ frontend/src/components/Dashboard.js (892 lines)
- Python 3.7+
- Rich library (automatically installed with pip)
MIT License