BigO Lens🔍 Inline Big-O Time & Space Complexity for VS CodeSee your algorithm's complexity as you write it. No AI, no API keys, fully offline. ⨠Features🏷ī¸ Inline Complexity AnnotationsSee 🎨 Color-Coded SeverityInstantly know if your solution is optimal:
📐 Smart CodeLensClickable complexity summary above every function with:
🏷ī¸ Pattern DetectionAutomatically identifies which algorithm technique you're using:
💡 Optimization HintsWhen your code exceeds the complexity threshold, BigO Lens suggests specific improvements:
🔗 LeetCode IntegrationIf your function name matches a LeetCode pattern (e.g.,
📄 Complexity ReportGenerate a beautiful markdown report of all functions in your file â perfect for interview prep review. Command: 📦 InstallationFrom VS Code Marketplace
From Command Line
🚀 Quick Start
No configuration needed â it works out of the box! âī¸ ConfigurationAll settings are optional. BigO Lens works with sensible defaults.
Example
|
| Code Pattern | Time Complexity |
|---|---|
Single for/while loop |
O(n) |
| Nested loops (2 levels) | O(n²) |
| Nested loops (3 levels) | O(nÂŗ) |
.sort() call |
O(n log n) |
| Binary search (left/right/mid) | O(log n) |
| Direct recursion (no memo) | O(2âŋ) |
| Recursion with memoization | O(n) |
.forEach(), .map(), .filter() |
O(n) per level |
| Allocation Pattern | Space Complexity |
|---|---|
new Map() / new Set() |
O(n) |
new Array(n) |
O(n) |
| 2D DP table | O(n²) |
| No extra allocations | O(1) |
| Recursive call stack | O(n) or O(log n) |
🗣ī¸ Commands
| Command | Description |
|---|---|
BigO Lens: Analyze Current File |
Force re-analyze the active file |
BigO Lens: Export Complexity Report |
Generate a markdown report |
BigO Lens: Toggle Inline Annotations |
Show/hide inlay hints |
🌐 Supported Languages
- â
TypeScript (
.ts) - â
JavaScript (
.js) - â
TypeScript React (
.tsx) - â
JavaScript React (
.jsx)
🗺ī¸ Roadmap
- [ ] Complexity comparison mode (multiple solutions side-by-side)
- [ ] Python support
- [ ] Java / C++ support
- [ ] Workspace-wide complexity dashboard
- [ ] Custom pattern plugins
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
📝 Changelog
See CHANGELOG.md for the full release history.
📄 License
If BigO Lens helps your DSA prep, give it a â on GitHub!
Made with â¤ī¸ for the competitive programming and interview prep community.