🍬 Sweet for Visual Studio Code
Real-time code health alerts for professional developers.
Sweet is a blazing-fast code health analyzer designed to keep project architectures lean and sustainable. It identifies technical debt, tangled dependencies, and complex logic patterns.
🍬 Features
File Size Guardian: Get immediate warnings when a file exceeds your defined line limit. Keep your modules focused and atomic.
Import Overload Detection: Automatically identifies when a file has too many dependencies, signaling a potential violation of the Single Responsibility Principle.
Deep Integration: Create a .swtrc configuration. It respects your hierarchical rules and custom thresholds.
Lightweight: Built in Rust-powered logic to ensure zero lag in your typing experience.
🍭 How it works
The extension monitors your active editor and triggers VSCode Warnings (yellow squiggles) when:
- The Line Count exceeds your threshold (Default: 250 lines).
- The Import Count is too high for the specific language (e.g., >15 imports in Rust).
This extension currently focuses on real-time structural health.
For deep metrics like code duplication (Copy-Paste detection) and global project analysis, please take a look at Sweet (CLI).
🍬 Global Metrics & Duplication
The VSCode extension is designed for local file health. To get the full picture of your project's technical debt, use swt in your terminal or CI:
# Detect duplicated code across the entire project
swt . --inspect
Want to automate this? Check out Refinery-RS to integrate these metrics directly into your GitHub Pull Requests.
⚙️ Configuration
Sweet will automatically look for a .swtrc file in your workspace root. If none is found, it uses these sensible defaults:
{
"thresholds": {
"global": {
"max_lines": 250
},
"overrides": {
"rust": { "max_imports": 15 },
"typescript": { "max_imports": 20 }
}
}
}
🤝 Contributing
This extension is part of the Sweet Ecosystem. If you want to improve the VSCode integration or add support for more languages, feel free to open an issue or PR in the main repository.
Happy coding! Stay Sweet. 🍭