Transform your code visibility with intelligent line counting, visual indicators, and comprehensive reporting
A Visual Studio Code extension that counts lines of code in your project and generates beautiful HTML reports with XML data sources. Features intelligent file explorer integration with customizable emoji indicators, performance-optimized caching, and support for 78+ programming languages and file types.
๐ MAJOR RELEASE v1.1.0: Revolutionary language support expansion with systematic coverage across all major programming paradigms! Now supporting 78+ languages from web development to enterprise systems. See CHANGELOG.md for complete details.
๐ src/
โโโ service.ts
โโโ utils.ts
โโโ ๐ components/
โโโ legacy.ts๐ src/ ๐จ๐ด # (avg 917 lines, max 2,847 lines)
โโโ service.ts ๐ข # (156 lines)
โโโ utils.ts ๐ข # (42 lines)
โโโ ๐ components/ ๐ฅ๐ด # (avg 2,847 lines, max 2,847 lines)
โโโ legacy.ts ๐ด # (2,847 lines)| Role | Primary Benefit |
|---|---|
| Software Developer | Real-time complexity feedback during coding |
| Solution Architect | Project-wide code quality metrics |
| Team Lead | Standardized complexity indicators across team |
| DevOps Engineer | Automated reporting for CI/CD pipelines |
| Technical Writer | Code statistics for documentation |
| Open Source Maintainer | Contributor-friendly project insights |
- Live Status Bar: Current file metrics at a glance
- Emoji Indicators: ๐ข๐ก๐ด badges for instant complexity assessment
- File Explorer Integration: Visual cues directly in your project tree
- Activate: Extension activates automatically on startup
- ๐๏ธ Database-Powered: Lightning-fast SQLite database replaces scattered JSON files (10-100x performance boost)
- ๐ Organized Structure: All extension data in clean
.vscode/code-counter/directory with reports inreports/subfolder - ๐ฏ Context Menu Magic: Right-click any file/folder for instant exclusion management
- ๐ Professional Reporting: Advanced standalone HTML reports with interactive filtering, grouping, and multiple export formats
- ๐จ Enhanced UI Controls: Group by language/directory, advanced filtering, and export to CSV/JSON/XML
- ๐ง Directory Management: Smart directory filtering with expand/collapse controls and hidden directory toggle
- For Architects: Comprehensive project analytics with minified, self-contained reports
- For Developers: Real-time visual feedback on code complexity with fun emoji indicators
- For Teams: Standardized code metrics with professional export capabilities
- For VS Code Enthusiasts: Professional-grade extension with cutting-edge reporting features
- Install: Search "Code Counter" in VS Code Extensions
- Activate: Extension activates automatically on startup
- Customize: Press
Ctrl+Shift+Pโ "CodeCounter: Customize Emoji Indicators" - View: See emoji badges (๐ข๐ก๐ด) next to files in explorer
- Reports: Run "Count Lines of Code" command for professional interactive HTML reports
- Export: Use webView "Export HTML" for standalone reports with filtering and export capabilities
v1.0.0 introduces revolutionary SQLite database architecture:
- Lightning Fast: 10-100x performance boost over JSON files
- Zero Dependencies: Pure JavaScript sql.js - no native compilation required
- Organized Structure: All extension data in
.vscode/code-counter/code-counter.db- High-performance SQLite settings databasereports/- All your HTML/XML/JSON reports
- Automatic Migration: Seamlessly imports existing
.code-counter.jsonfiles - Hierarchical Inheritance: Workspace settings cascade to subdirectories
- โ๏ธ Hierarchical Workspace Settings: Workspace/Directory-specific configurations with inheritance
- โ๏ธ๐จ Emoji Customization: Choose ANY emoji for your line count thresholds
- ๐ Glob Pattern Manager: Visual interface for managing file exclusion patterns
- โจ๏ธ Language Support: 78+ programming languages and file types
- ๐ Smart Search: Find emojis by typing "smile", "heart", "circle", etc.
- ๐ง Smart Exclusions: Configurable patterns (node_modules, build files, etc.)
- โก Performance First: Intelligent caching and real-time updates
- ๐ Professional Reports: Interactive HTML reports with grouping, filtering, and multi-format exports
- ๐๏ธ Advanced UI Controls: Group by language/directory, expand/collapse trees, smart filtering
- ๐ง WebView Enhancements: Export HTML with same professional quality as command palette reports
- ๐ฏ 127-Line Rule: Based on proven software engineering principles
- ๐จ Theme Integration: Respects VS Code's color schemes
๐จ A long time ago (in technology generations), someone ran a statistical test to see how many lines of code a single file could contain that a single developer could "eyeball" and ensure working code; that number was about 127 lines. In other words, a single developer could ensure "bug-free" code by segmenting code and organizing it so that files have ~127 lines on average. It's one of those good "rules of thumb" behaviors that's learned (typically through debug hell) the hard way. That's where CodeCounter comes in. Simply, it counts lines in files, and alerts users that documents are getting too large for human consumption. It's not meant as a strict limitation for files, but is useful metadata about the file that coders/writers can use to organize their data in the best possible manner.
- Flexible Thresholds: Configure your own complexity boundaries
- Emoji Customization: Choose your preferred indicator system
v1.0.0: Revolutionary SQLite-powered configuration management
- Lightning-fast SQLite database replaces scattered JSON files
- 10-100x performance improvement for settings lookup
- All configuration data centralized in
.vscode/code-counter/code-counter.db - Atomic operations prevent configuration corruption
- Unified settings interface through webview
- Real-time emoji customization with live preview
- Advanced glob pattern management with validation
- Automatic migration from legacy JSON configurations
- All extension data organized in
.vscode/code-counter/directory - Separate
reports/subfolder for HTML/XML output - Clean workspace with no scattered configuration files
- Easy backup and synchronization of all extension data
- ๐ Interactive Tables: Sortable, filterable tables with real-time search
- ๐๏ธ Group Controls: Group by language or directory with one-click buttons
- ๐ Advanced Filtering: Filter by language, line count ranges, and file size
- ๐งน Clear Functions: Reset all filters and grouping with a single button
- ๐ฑ Responsive Design: Professional layout that works across all screen sizes
- ๐ Multiple Formats: Export to CSV, JSON, and XML with consistent data structure
- โก Professional Minification: Optimized HTML with terser, clean-css, and html-minifier-terser
- ๐ฆ Self-Contained Reports: Standalone HTML files with all dependencies embedded
- ๐ Export Integration: WebView and standalone reports use the same professional generation pipeline
- ๐ Metadata Support: All exports include "Generated At" timestamps for tracking
- ๐ Smart Directory Management: Filter directories with "All", "All + Hidden", and "Active" modes
- ๐๏ธ Expand/Collapse Controls: Individual directory expansion with โถ/โผ glyphs
- ๐ง Bulk Operations: "Expand All" and "Collapse All" buttons for quick navigation
- ๐๏ธ Hidden Directory Toggle: Show/hide hidden directories and their subdirectories
- โ๏ธ Settings Organization: Clean, organized settings interface with hierarchical directory display
- ๐ Count Lines of Code: Analyzes all files in your workspace with smart caching
- ๐ Detailed Statistics: Shows code lines, comment lines, and blank lines separately
- ๐ Enhanced HTML Reports: Beautiful, interactive HTML reports with intelligent path display system
- ๐ Smart Path Toggle: Interactive button to show/hide full directory paths
- ๐ฏ Optimized Layout: Clean filename display with expandable path information
- ๐พ Persistent Preferences: Remembers your path display choice across sessions
- ๐๏ธ Enhanced XML Data: Comprehensive XML exports with streamlined data structure
- ๐ Clean Data Format: Optimized structure focusing on essential information
- ๐ Consistent Exports: Unified data format across CSV, JSON, and XML exports
- โก Performance Optimized: Only recalculates on file save, not every keystroke
- ๐ฏ Glob Exclusions: Exclude files and directories using customizable glob patterns
- ๐จ Visual Indicators: Customizable emoji indicators next to files in explorer (๐ข๐ก๐ด by default)
- ๐ Status Bar Integration: Live line counts for active files with hover tooltips
- ๐ File Explorer Integration: Non-intrusive indicators that don't interfere with Git colors
- Cross-Project Consistency: Same metrics across all codebases
- Team Alignment: Visual indicators everyone understands
- Technical Debt Tracking: Identify refactoring candidates
- Documentation Integration: Embed reports in architecture docs
- โ 261/261 Tests Passing - Comprehensive test coverage with all features tested
- โ 41% Code Coverage - Real metrics, not estimates```
- โ TypeScript 5.2+ - Modern, type-safe codebase
- โ Zero Dependencies - Lightweight and secure
- Comprehensive VS Code API Mock: 15+ API surfaces for testing
- Intelligent File Watching: Performance-optimized change detection
- Memory Efficient: Proper resource disposal and caching
- Extensible Architecture: Clean service-based design
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X) - Search for "Code Counter"
- Click "Install" on the DelightfulGames.vscode-code-counter extension
install-extension DelightfulGames.vscode-code-counter- Download the latest
.vsixfile from GitHub Releases - Run:
code --install-extension vscode-code-counter-*.vsix
- Manually trigger line counting and report generation
- โ Code Counter: Count Lines of Code (
codeCounter.countLines)
- โ Code Counter: Count Lines of Code (
- Opens comprehensive settings interface featuring:
- โ Code Counter: Customize Emoji Indicators (
codeCounter.openSettings)
- โ Code Counter: Customize Emoji Indicators (
- Reset the plugin to the defaults
- โ Code Counter: Reset Emoji Indicators to Defaults (
codeCounter.resetBadgeSettings)
- โ Code Counter: Reset Emoji Indicators to Defaults (
Right-click on files or folders in the File Explorer or Editor Tab to access exclusion commands:
- CodeCounter: Exclude This File/Folder: Adds the relative path to workspace settings
- CodeCounter: Exclude Files/Folders with Same Name: Adds a global pattern (e.g.,
**/README.md) to exclude all files with the same name - CodeCounter: Exclude Files with Same Extension: Adds a global pattern (e.g.,
**/*.log) to exclude all files with the same extension
๐ก Smart Configuration: Exclusion patterns are managed through the SQLite database in
.vscode/code-counter/code-counter.db. The settings webview and file decorators automatically refresh when exclusion patterns are added through context menus.
- Emoji Badge Indicators: Visual badges (๐ข๐ก๐ด๐ฉ๐จ๐ฅ) that don't interfere with Git status colors
- Non-Intrusive Design: File names keep their normal colors (green for new, red for modified, etc.)
- Smart Updates: Only recalculates on file save, not every keystroke
- Hover Tooltips: Simple "Lines: X" format for consistency
- Live Display: Shows line count for active file with badge
- Hover Tooltips: Simple "Lines: X" format for consistency
The extension provides comprehensive emoji customization options:
- Universal Emoji Support: Choose ANY emoji for your line count thresholds
- Professional Emoji Picker: Search through 1800+ emojis by name and aliases
- Searchable Database: Find emojis by typing "smile", "heart", "circle", "warning", etc.
- Category Organization: Browse emojis by category (Smileys, Symbols, Objects, etc.)
- Examples:
- Traditional: ๐ข ๐ก ๐ด (traffic light system)
- Creative: ๐ฏ ๐ฅ ๐ฏ (target/performance theme)
- Professional: โ
โ ๏ธ โ (status indicators) - Fun: ๐ ๐ ๐ฑ (emotion-based)
- Examples:
- Unified Configuration: Set both emoji badges AND thresholds in one interface
- Flexible Thresholds: Configure exact line count boundaries for each badge level
- WebView Interface: Professional emoji picker with search and live preview
Manage file exclusion patterns through the enhanced settings interface:
- ๐ Visual Pattern Manager: Add/remove glob patterns with intuitive interface
- โ Pattern Validation: Real-time validation prevents invalid glob patterns
- ๐ Built-in Examples: Common patterns like
**/node_modules/**,**/*.tmp - ๐ Easy Reset: Restore default exclusion patterns with one click
- ๐ฏ Smart Defaults: Pre-configured to exclude common build artifacts and dependencies
- ๐ก Interactive Help: Expandable examples section with pattern explanations
- โจ๏ธ Keyboard Support: Press Enter to add patterns quickly
The extension provides several configuration options to customize behavior:
codeCounter.showNotificationOnAutoGenerate(default:false)- Controls whether popup notifications appear when reports are auto-generated on file save
- Set to
trueto enable popup notifications with "View Report" button - Set to
falsefor silent operation (recommended for focused coding) - ๐ก Tip: Use the checkbox in the settings webview (
Code Counter: Customize Emoji Indicators) for easy toggling
codeCounter.autoGenerate(default:true)- Enable/disable automatic report generation when files are saved
- When disabled, reports are only generated via manual command execution
The extension generates two files in the configured output directory:
- Intelligent Caching: Modification-time based invalidation
code-counter-report.html: Interactive HTML report with charts and tables
- Event-Driven Updates: Real-time file system watching
code-counter-data.xml: XML data source for integration with other tools
- Unit Tests: 261 comprehensive tests across multiple test suites covering all features
- Integration Tests: VS Code API compatibility validation
- Performance Tests: File system operation optimization
- Coverage Analysis: 41% real coverage with C8 tooling
- Save-Based Updates: Only recalculates when files are saved, not on every keystroke
- Selective File Watching: Only monitors relevant code files, ignores binaries and build outputs
- Intelligent Caching: Modification time-based cache invalidation for accuracy
- Efficient Event Handling: Debounced file system events prevent performance loops
- Memory Management: Proper disposables prevent memory leaks
- Battery Friendly: Minimal background processing for laptop users
- Service-Oriented Design: Modular, testable components
- Memory Management: Proper disposal patterns
- Command Palette: Full VS Code command system integration
- Status Bar Integration: Non-intrusive information display
- File Explorer Decorators: Native VS Code theming support
- Configuration API: Seamless settings management
The extension automatically detects and counts lines for 78+ programming languages and file types, including:
- Web Development: JavaScript, TypeScript, JSX, TSX, HTML, CSS, SCSS, Sass, Less, CoffeeScript, LiveScript
- Systems Programming: C, C++, C#, Java, Go, Rust, Swift, Kotlin, Scala, Dart, Assembly, Zig, V, Nim, Crystal
- Scripting & Shell: Python, Ruby, PHP, Shell, Bash, Zsh, Fish, PowerShell, Batch, AWK, Tcl
- Functional Programming: Haskell, Erlang, Elixir, Clojure, F#, OCaml, Scheme, Racket
- Mobile & Platform: Swift, Kotlin, Scala, Dart, Objective-C, Vala
- Data Science & Analytics: R, MATLAB, Julia, SQL
- Enterprise & Legacy: COBOL, Fortran, Visual Basic, Pascal, Ada, Groovy, Delphi
- Specialized Languages: GraphQL, Protocol Buffers, ANTLR
- Build & Project: CMake, Makefile, Dockerfile, TOML, YAML, JSON, XML
- Development Tools: Environment files, Properties, GitIgnore, EditorConfig
- Documentation: Markdown, Text, INI, Config files
๐ Total Coverage: 78+ languages with intelligent comment detection and proper line counting algorithms for each language family.
If you find the emoji badges (๐ข๐ก๐ด) in the File Explorer too small or hard to distinguish, you can increase VS Code's zoom level to make them larger and more visible:
- Zoom In:
Ctrl++(Windows/Linux) orCmd++(Mac) - Zoom Out:
Ctrl+-(Windows/Linux) orCmd+-(Mac) - Reset Zoom:
Ctrl+0(Windows/Linux) orCmd+0(Mac)
- Open Settings:
Ctrl+,(Windows/Linux) orCmd+,(Mac) - Search: Type
window.zoomLevel - Adjust: Set a value like
1(120% zoom) or2(140% zoom)0= 100% (default)1= 120% zoom2= 140% zoom0.5= 110% zoom (fine adjustment)
- ๐๏ธ Better Visibility: Emoji badges become larger and easier to distinguish
- ๐ฏ Improved Accuracy: Easier to spot complexity hotspots at a glance
- โฟ Accessibility: Better for users who prefer larger interface elements
- ๐ฅ๏ธ High-DPI Displays: Especially helpful on high-resolution monitors
๐ก Pro Tip: The zoom level affects the entire VS Code interface, making not just emoji badges but all text and UI elements larger and more comfortable to work with!
- Your path display preference is automatically saved using localStorage
- Consistent experience across all reports and browser sessions
- No need to repeatedly adjust settings
- Clean Layout: Filenames prominently displayed with subtle path information
- Responsive Design: Works beautifully on all screen sizes
- Visual Hierarchy: Clear distinction between filename and directory path
- HTML Reports: Interactive reports with enhanced path toggle functionality
- XML, JSON, CSV
- Backward Compatible: Existing integrations continue to work seamlessly
The generated reports include:
- Summary Statistics: Total files, lines, languages, and averages
- Language Breakdown: Files and lines per programming language
- Grouping Controls: data can be grouped by directory or language
- Enhanced File Details: Searchable table with intelligent path display and individual file statistics
- Interactive Elements: Search, filtering, and responsive design
We welcome contributions from developers, architects, and VS Code enthusiasts! CONTRIBUTING.md
| Document | Audience | Content |
|---|---|---|
| ๐ Contributing Guide | Contributors | Development workflow and standards |
| ๐ Testing Guide | Contributors | Test execution and coverage |
| ๐๏ธ Architecture Docs | Developers | Technical implementation details |
- ๐ Advanced Analytics: Complexity trends over time
- ๐ค AI Integration: Smart refactoring suggestions
- ๐ Git Integration: Blame-aware complexity analysis# Lint code
- ๐ฑ Web Dashboard: Team-wide project insights
- ๐ Issues: GitHub Issues
- ๐ก Feature Requests: GitHub Discussions
- ๐ง Contact: code-counter@delightfulgames.com
This project is licensed under the MIT License - see the LICENSE file for full details.
- โ Free to use - Personal and commercial use allowed
- โ Free to modify - Create your own versions and improvements
- โ Free to distribute - Share with others, including modified versions
- โ Attribution required - Just keep the original copyright notice
- โ No warranty - Provided "as-is" without guarantees
TL;DR: Use it freely, modify it as needed, just give credit to the original project!


