The Ultimate Codebase Analysis & Management Tool
Comprehensive security scanning, dependency analysis, code quality metrics, and comment management in one powerful CLI tool.
Features • Installation • Quick Start • Documentation • Examples
CodeAtlas is a production-ready, feature-rich CLI tool that provides comprehensive codebase analysis, security scanning, dependency management, code quality metrics, and interactive comment editing. Built with Python 3.10+ and designed to scale to repositories with 100k+ files.
- 🔒 Security First: Built-in vulnerability scanning with Bandit, Safety, npm audit, and more
- 📦 Dependency Intelligence: Multi-language dependency analysis with update detection
- 📊 Quality Metrics: Advanced complexity analysis and maintainability scoring
- 📜 License Compliance: Automatic license detection and compatibility checking
- 💬 Comment Management: Interactive TUI for reviewing and editing comments
- ⚡ Blazing Fast: Parallel processing with intelligent caching
- 🎨 Beautiful Output: Rich terminal UI with color-coded tables and progress indicators
- 🔌 Extensible: Plugin system for custom analysis
- Bandit Integration: Scans Python code for security issues
- Dependency Vulnerability Checks: Safety, pip-audit, npm audit support
- Generic Security Patterns: Detects hardcoded secrets, SQL injection risks, command injection
- Severity Classification: Categorizes issues by criticality (critical, high, medium, low)
- Detailed Reporting: File locations, line numbers, and code snippets
- Multi-Language Support: Python (pip, poetry, pipenv), Node.js (npm), Go, Rust
- Update Detection: Identifies outdated packages automatically
- License Information: Shows dependency licenses and compatibility
- Lock File Detection: Validates presence of lock files for reproducible builds
- Package Manager Detection: Auto-detects package managers in use
- Cyclomatic Complexity: Measures code complexity and branching
- Cognitive Complexity: Analyzes code understandability
- Maintainability Index: Calculates code maintainability score (0-100)
- Halstead Volume: Estimates code complexity metrics
- Technical Debt Assessment: Categorizes files by complexity level
- Top Issues Identification: Highlights most complex files
- Project License Detection: Finds licenses from multiple sources (LICENSE, package.json, pyproject.toml, setup.py)
- Dependency License Analysis: Checks all dependency licenses
- Compatibility Checking: Detects incompatible license combinations
- OSI/FSF Approval: Validates licenses against OSI/FSF standards
- Risk Assessment: Categorizes licenses by risk level
- Interactive TUI: Beautiful Textual-based interface for comment review
- Context-Aware Editing: See code context when editing comments
- Batch Operations: Edit multiple comments efficiently
- Safety Features: Automatic backups with undo support
- Filtering: Filter by file, language, or text pattern
- Language Detection: Detects 50+ languages by extension, shebang, and content
- Comprehensive Statistics: Per-file and per-language metrics
- Project Tree Generation: ASCII, Rich (colors + icons), and Markdown formats
- Git Integration: Auto-detects repos, respects .gitignore, shows git status
- Export Formats: JSON, YAML, Markdown, CSV with stable schemas
- Trailing Spaces: Remove trailing whitespace
- Indentation Normalization: Standardize indentation
- Duplicate Blank Lines: Remove excessive blank lines
- Commented Code Detection: Find and optionally remove commented-out code
- Dry-Run Mode: Preview changes before applying
- Plugin System: Extensible architecture with sandboxed execution
- Custom Hooks: on_scan, on_export, on_edit hooks
- Easy Integration: Simple plugin API
- Duplicate Block Detection: Finds repeated code blocks
- Similarity Analysis: Calculates similarity percentage
- Multiple Occurrences: Tracks all locations of duplicates
- Refactoring Suggestions: Identifies code that should be extracted
- Unused Functions: Detects functions that are never called
- Unused Classes: Finds classes that are never instantiated
- Unused Imports: Identifies imports that are never used
- Unreachable Code: Finds code that can never be executed
- Entropy Detection: Finds high-entropy strings (likely secrets)
- File Secret Detection: Identifies secret files (.env, keys, etc.)
- Git Ignore Validation: Checks if secrets are properly ignored
- Pattern Matching: 30+ security patterns for comprehensive scanning
We provide beautiful, interactive installation scripts that handle everything automatically:
Python Script (Cross-platform, Recommended):
# Clone the repository
git clone https://github.com/sarat1kyan/CodeAtlas.git
cd CodeAtlas
# Run interactive installer
python install.pyBash Script (Linux/Mac):
# Make executable and run
chmod +x install.sh
./install.shWindows Batch Script:
# Run in Command Prompt
install.batWhat the installer does:
- ✅ Checks Python version (3.10+)
- ✅ Detects available package manager (pip, pip3, poetry, pipenv)
- ✅ Creates virtual environment (with option to customize location)
- ✅ Installs all dependencies automatically
- ✅ Optionally installs security tools (bandit, safety, pip-audit)
- ✅ Verifies installation
- ✅ Shows beautiful usage instructions with next steps
- ✅ Beautiful Rich UI with progress bars and colored output
- ✅ Graceful fallback if Rich is not available
To remove CodeAtlas and its virtual environment:
Python Script:
python install.py --uninstall
python install.py --uninstall --remove-config # Also remove config filesBash Script:
./install.sh --uninstall
./install.sh --uninstall --remove-config # Also remove config filesWindows Batch:
install.bat --uninstall
install.bat --uninstall --remove-config # Also remove config filesThe uninstaller will:
- ✅ Find virtual environments automatically
- ✅ Let you select which venv to remove (if multiple)
- ✅ Ask for confirmation before removal
- ✅ Optionally remove configuration files
- ✅ Show beautiful confirmation messages
If you prefer manual installation:
# Clone the repository
git clone https://github.com/sarat1kyan/CodeAtlas.git
cd CodeAtlas
# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Linux/Mac:
source venv/bin/activate
# Install in development mode
pip install -e .
# Or with development dependencies
pip install -e ".[dev]"To manually uninstall:
# Remove virtual environment
rm -rf venv # Linux/Mac
rmdir /s /q venv # Windows
# Optionally remove config files
rm -rf .codeatlas # Local config
rm -rf ~/.config/CodeAtlas # Global config (Linux/Mac)- Python 3.10+ (3.11+ recommended)
- pip or pip3 (automatically detected)
- Dependencies are automatically installed by the installer
The interactive installer supports:
- Virtual Environment: Automatically creates and manages venv
- Package Manager Detection: Auto-detects pip, pip3, poetry, pipenv
- Development Mode: Option to install dev dependencies
- Optional Tools: Option to install security scanning tools
- Custom Location: Choose where to create virtual environment
- Verification: Automatically verifies installation success
For enhanced functionality, you can optionally install:
# Python security tools
pip install bandit safety pip-audit pip-licenses
# Node.js tools (if working with Node.js projects)
# Option 1: Install globally (requires sudo on Linux/Mac)
sudo npm install -g license-checker
# Option 2: Install locally in your project (recommended - no sudo needed)
npm install --save-dev license-checker
# Then use: npx license-checker
# Option 3: Use npm's built-in audit (no installation needed)
# npm audit is built into npm, no additional installation requiredNote:
- CodeAtlas works without these tools, but they enable additional features like security scanning and license checking.
- For npm tools, if you get
EACCES: permission deniederrors, usesudoor install locally in your project (Option 2).npm auditis built into npm and works without any additional installation.- Most features work without external tools - they're optional enhancements.
# Basic scan
codeatlas scan /path/to/your/project
# Comprehensive scan with all features
codeatlas scan . --security --dependencies --quality --licenses# Check for security vulnerabilities
codeatlas security /path/to/project
# Export security report
codeatlas security . --output security-report.json# Check for outdated dependencies
codeatlas dependencies /path/to/project
# Check with update detection
codeatlas dependencies . --check-updates# Analyze code complexity and maintainability
codeatlas quality /path/to/project
# Export quality metrics
codeatlas quality . --output quality-report.json# List all comments
codeatlas comments /path/to/project
# Interactive TUI
codeatlas comments /path/to/project --tui
# Filter comments
codeatlas comments . --language Python --text "TODO"# Find duplicate code blocks
codeatlas duplicates /path/to/project
# Custom thresholds
codeatlas duplicates . --min-lines 10 --min-similarity 90# Detect unused code
codeatlas deadcode /path/to/project# Get complete codebase overview
codeatlas summary /path/to/project
# With export
codeatlas summary . --output summary.jsonScan your codebase with optional security, dependency, quality, and license checks.
codeatlas scan <path> [OPTIONS]Options:
--skip-gitignored: Skip files listed in.gitignore--output, -o: Output file for JSON report--format, -f: Output format (table,json,yaml)--security: Include security vulnerability scan--dependencies: Include dependency analysis--quality: Include code quality analysis--licenses: Include license compliance check--duplicates: Include code duplication detection--deadcode: Include dead code detection--all: Run all analysis (comprehensive scan)
Examples:
# Basic scan
codeatlas scan .
# Full comprehensive analysis
codeatlas scan . --all --output report.json
# Selective analysis
codeatlas scan . --security --quality --duplicatesScan for security vulnerabilities and dependency issues.
codeatlas security <path> [--output OUTPUT]Features:
- Python code security (Bandit)
- Dependency vulnerabilities (Safety, pip-audit)
- Node.js vulnerabilities (npm audit)
- Generic security pattern detection
Example:
codeatlas security . --output security-report.jsonCheck dependencies for updates, licenses, and issues.
codeatlas dependencies <path> [--check-updates] [--output OUTPUT]Features:
- Multi-language support (Python, Node.js, Go, Rust)
- Outdated package detection
- License information
- Lock file validation
Example:
codeatlas dependencies . --check-updatesAnalyze code complexity, maintainability, and quality metrics.
codeatlas quality <path> [--output OUTPUT]Metrics:
- Cyclomatic complexity
- Cognitive complexity
- Maintainability index
- Technical debt assessment
Example:
codeatlas quality . --output quality-report.jsonCheck project and dependency licenses for compliance.
codeatlas licenses <path> [--output OUTPUT]Features:
- Project license detection
- Dependency license analysis
- Compatibility checking
- Risk assessment
Example:
codeatlas licenses . --output licenses.jsonList, review, and manage comments in your codebase.
codeatlas comments <path> [OPTIONS]Options:
--file PATTERN: Filter by file path pattern--language LANG: Filter by language--text REGEX: Filter by text regex--tui: Launch interactive TUI--output, -o: Export comments to JSON
Examples:
# List all comments
codeatlas comments .
# Interactive TUI
codeatlas comments . --tui
# Filter Python TODOs
codeatlas comments . --language Python --text "TODO"Edit or delete comments in files.
codeatlas edit <file:line> [OPTIONS]Options:
--replace TEXT: New comment text--delete: Delete comment--dry-run: Show diff without applying--apply: Apply changes (required for non-dry-run)
Example:
codeatlas edit src/main.py:42 --replace "Updated comment" --applyGenerate beautiful project tree visualizations.
codeatlas tree <path> [OPTIONS]Options:
--format, -f: Format (ascii,rich,markdown)--max-depth, -d: Maximum depth--files/--no-files: Include/exclude files--size: Include file sizes--output, -o: Output file
Examples:
# Rich tree with colors
codeatlas tree . --format rich
# Markdown export
codeatlas tree . --format markdown --output tree.mdClean up code files with various options.
codeatlas cleanup <path> [OPTIONS]Options:
--remove-trailing-spaces: Remove trailing whitespace--normalize-indentation: Normalize indentation--tab-width WIDTH: Tab width for indentation (default: 4)--remove-duplicate-blanks: Remove duplicate blank lines--max-blanks N: Max consecutive blank lines (default: 2)--remove-commented-code: Remove commented-out code--dry-run: Preview changes without applying
Example:
codeatlas cleanup . --remove-trailing-spaces --dry-runExport scan results to various formats.
codeatlas export <path> <output> [OPTIONS]Options:
--format, -f: Format (json,yaml,markdown,csv)--skip-gitignored: Skip gitignored files
Example:
codeatlas export . report.json --format jsonDetect duplicate code blocks in your codebase.
codeatlas duplicates <path> [--min-lines LINES] [--min-similarity PERCENT] [--output OUTPUT]Options:
--min-lines: Minimum lines for duplicate block (default: 5)--min-similarity: Minimum similarity percentage (default: 80.0)--output, -o: Export results to JSON
Example:
codeatlas duplicates . --min-lines 10 --output duplicates.jsonFind unused functions, classes, and imports.
codeatlas deadcode <path> [--output OUTPUT]Example:
codeatlas deadcode . --output deadcode.jsonGenerate a complete codebase overview with all metrics.
codeatlas summary <path> [--output OUTPUT]Features:
- Health score calculation
- All metrics in one view
- Quick overview of codebase status
Example:
codeatlas summary . --output summary.jsonManage CodeAtlas plugins.
codeatlas plugins [--list] [--load PLUGIN]Example:
codeatlas plugins --list# In your CI pipeline
codeatlas scan . --security --dependencies --quality --licenses --output report.json
# Check for critical security issues
codeatlas security . --output security.json
if grep -q '"severity": "critical"' security.json; then
echo "Critical security issues found!"
exit 1
fi# Check code quality before committing
codeatlas quality . --output quality.json
codeatlas security . --output security.json# Weekly dependency check
codeatlas dependencies . --check-updates --output deps.json# Before releasing
codeatlas licenses . --output licenses.jsonCodeAtlas supports both global and local configuration:
- Global:
~/.config/CodeAtlas/config.yml - Local:
.codeatlas/config.yml(project-specific)
theme: default
cache:
enabled: true
directory: .codeatlas/cache
backup:
enabled: true
directory: .codeatlas/backups
max_backups: 10
scan:
parallel_workers: null # Auto-detect
skip_binary: true
skip_gitignored: false
max_file_size_mb: 10
cleanup:
remove_trailing_spaces: false
normalize_indentation: false
tab_width: 4
max_consecutive_blanks: 2
remove_commented_code: false{
"base": "/path/to/repo",
"total_files": 1234,
"total_dirs": 56,
"total_size_bytes": 12345678,
"total_lines": 50000,
"total_blank": 5000,
"total_comments": 3000,
"total_code": 42000,
"per_language": {
"Python": {
"files": 100,
"lines": 10000,
"code": 8000,
"comments": 1000,
"blank": 1000,
"bytes": 500000
}
},
"security": {
"total_issues": 5,
"issues_by_severity": {
"critical": 0,
"high": 2,
"medium": 3
}
},
"dependencies": {
"total_dependencies": 45,
"outdated_count": 3
},
"quality": {
"average_complexity": 8.5,
"average_maintainability": 72.3
},
"licenses": {
"project_license": "MIT",
"incompatible_count": 0
}
}Create custom plugins in the codeatlas_plugins/ directory.
def plugin_info():
return {
"name": "my_plugin",
"version": "1.0.0",
"author": "Your Name"
}
def on_scan(scan_result):
# Process scan result
return None
def on_export(scan_result, export_type):
# Process before export
pass
def on_edit(pre_edit_state, planned_changes):
# Validate or modify edits
return planned_changesgit clone https://github.com/sarat1kyan/CodeAtlas.git
cd CodeAtlas
pip install -e ".[dev]"pytestblack codeatlas tests
isort codeatlas tests
mypy codeatlas
ruff check codeatlasContributions are welcome! Please see CONTRIBUTING.md for guidelines.
- 🐛 Bug fixes
- ✨ New features
- 📚 Documentation improvements
- 🧪 Test coverage
- 🔌 Plugin development
- 🌍 Language support
MIT License - see LICENSE for details.
sarat1kyan
- GitHub: @sarat1kyan
- Repository: CodeAtlas
- Issues: Report a bug
If you encounter ResolutionImpossible or dependency conflict errors during installation:
The installer automatically tries multiple strategies:
- Standard installation
- Installation without build isolation
- Two-step installation (dependencies first, then package)
- Installation with PEP 517
Manual troubleshooting steps:
-
Update pip and build tools:
python -m pip install --upgrade pip wheel setuptools
-
Try installing without dev dependencies:
# When prompted, answer 'n' to "Install development dependencies?" # Or manually: pip install -e .
-
Install dependencies individually:
pip install rich typer textual pyyaml chardet pip install -e . --no-deps -
Use a different Python version:
- CodeAtlas requires Python 3.10+
- Python 3.11 or 3.12 are recommended
- Python 3.13 may have compatibility issues with some dependencies
-
Check for conflicting packages:
pip list # Check installed packages pip check # Check for conflicts
-
Clean installation:
# Remove existing venv and start fresh rm -rf venv python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows pip install --upgrade pip wheel setuptools pip install -e .
If all else fails:
- Check the full error message shown by the installer
- Report the issue with Python version and error details
- Try installing in a fresh virtual environment
If you encounter EACCES: permission denied when installing npm packages globally:
Solution 1: Use sudo (Linux/Mac)
sudo npm install -g license-checkerSolution 2: Install locally (Recommended)
# Install in your project
npm install --save-dev license-checker
# Use with npx (no global install needed)
npx license-checkerSolution 3: Fix npm permissions (Linux/Mac)
# Create a directory for global packages
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Add to your ~/.bashrc or ~/.zshrc
export PATH=~/.npm-global/bin:$PATHIf codeatlas dependencies shows 0 dependencies:
- Python projects: Make sure
requirements.txt,pyproject.toml, orsetup.pyexists - Node.js projects: Ensure
package.jsonexists and has dependencies listed - Empty projects: Projects without dependencies will correctly show 0
If codeatlas security shows 0 issues:
- This is normal! It means no vulnerabilities were detected
- External tools (bandit, safety) are optional - install them for more comprehensive scanning
- Generic security checks still run without external tools
Currently, code quality analysis focuses on Python files. Support for other languages is planned. The tool still provides:
- Language detection for all files
- File statistics for all languages
- Security scanning for multiple languages
Built with amazing open-source tools:
- Rich - Beautiful terminal output
- Typer - Modern CLI framework
- Textual - TUI framework
- PyYAML - YAML parsing
- Bandit - Security linter
- Safety - Dependency vulnerability checker
- Code duplication detection
- Dead code analysis
- Performance profiling
- Documentation coverage analysis
- Test coverage integration
- Architecture analysis
- Dependency graph visualization
- More language support
⭐ Star this repo if you find it useful! ⭐
CodeAtlas v0.1.0 - Production-ready codebase analysis and management.
Made with ❤️ by the CodeAtlas team