Code IQ
Code IQ is a professional, offline, privacy-first VS Code extension for local code intelligence.
It improves code quality, security awareness, maintainability, and refactoring confidence without leaving your machine.
Core Principles
- 100% offline analysis
- No external APIs
- No cloud services
- No authentication
- No telemetry
- No hidden data collection
What Code IQ Provides
1. Unused Code Detection
- Detects unused imports
- Detects unused variables
- Detects unused functions (workspace-level basic analysis)
- Adds diagnostics in the Problems panel
- Offers quick fixes for removing unused imports
2. Code Metrics Dashboard
- Total files
- Total lines of code
- Function count
- Class count
- Average file size
- Largest files
- Empty files
- Comment ratio
The dashboard auto-refreshes after analysis runs and updates from file save/workspace changes.
3. Complexity Analyzer
- Cyclomatic complexity per file
- Decision point counting (
if, switch, loops, nested conditions, logical operators)
- High-complexity diagnostics
- Project average complexity
4. Duplicate Code Detection
- Normalizes function bodies
- Hashes code blocks
- Detects repeated logic
- Highlights duplicate groups in Problems
- Suggests refactoring through diagnostics and dashboard insights
5. Security Scanner (Regex-Based, Local)
Detects local secret-like patterns such as:
- Hardcoded secrets
- API keys
- Tokens
- Password-like assignments
- Bearer tokens
- Private key blocks
Results appear in:
- Problems panel
- Security Findings TreeView
6. Project Health Score (0-100)
Health score factors:
- Unused code ratio
- Complexity level
- Duplicate code amount
- Large files
- Security issues
Displayed as:
- Status bar indicator
- Dashboard summary
- Color-coded status (
Green, Yellow, Red)
7. TODO Intelligence Panel
Extracts and surfaces:
Features:
- Sidebar TreeView
- Optional file-path filtering
- Click-to-navigate
8. Git Intelligence (Local CLI)
Uses only local git history to show:
- Most changed files
- Recent commit summary
- Commit frequency
- Large commits
- File change history
9. Import Organizer
- Sorts imports
- Removes unused import bindings
- Groups imports into External / Internal / Relative
- Supports one-click command execution
10. Folder Structure Analyzer
- Scans workspace tree
- Counts files per folder
- Detects deep nesting
- Exports structure as Markdown
Commands
| Command |
Description |
codeiq.analyzeProject |
Runs full offline project analysis |
codeiq.openDashboard |
Opens the Code IQ metrics dashboard |
codeiq.scanSecurity |
Runs security-focused scan and opens Security view |
codeiq.showTodos |
Shows TODO intelligence and optional file filter |
codeiq.generateHealthReport |
Generates a Markdown health report |
codeiq.organizeImports |
Organizes imports in the active file |
codeiq.exportFolderStructure |
Exports folder structure markdown |
Architecture Overview
src/extension.ts: command registration, views, status bar, lifecycle hooks
src/core/AnalysisService.ts: incremental orchestration and diagnostics publishing
src/analyzers/*: AST/file/git/folder/import analyzers
src/providers/*: TreeView providers and quick-fix code action provider
src/webview/DashboardPanel.ts: webview dashboard rendering
src/core/HealthScorer.ts: health score model and penalties
- Incremental cache keyed by file
mtime and size
- Concurrent file analysis with bounded worker count
- Non-blocking asynchronous operations
- Re-analysis on changed files through save/workspace hooks
Privacy and Security
Code IQ is intentionally local-only:
- No telemetry emitters
- No remote services
- No HTTP calls
- No account/session requirements
Build and Run
See INSTALLATION.md for setup, development, and packaging instructions.
Contribution
See CONTRIBUTING.md for contribution standards, review criteria, and coding workflow.
License
MIT