๐ฌ Sweet (swt)
Turn code maintainability into a measurable metric.
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.
๐ญ The Sweet Index
Sweet evaluates source files against configurable health thresholds.
| Status | Meaning | Action |
|---|---|---|
| Sweet ๐ญ | Balanced, cohesive, and easy to maintain. | Keep it up! |
| Bitter ๐ | Overly complex, high coupling, or high repetition. | Refactor recommended. |
โจ Key Features
- ๐ Blazing Fast: Process thousands of files in milliseconds (e.g., self-analysis in <10ms).
- ๐ Hierarchical Config: Support for multiple
.swtrcfiles to define specific rules for different subdirectories. - ๐ Global Inspection: Detect code duplication across the entire project with detailed reporting.
- ๐ก๏ธ Quality Guard: Built-in support for git hooks to prevent "Bitter" code from being pushed.
- ๐งน Source Cleanup: Professional comment stripping and whitespace normalization.
๐ Supported Languages
| Language | Extension | Import Style | Comment Style |
|---|---|---|---|
| Rust | .rs |
use |
//, /* */ |
| Python | .py |
import, from |
# |
| JavaScript | .js, .mjs, .cjs |
import, require |
//, /* */ |
| TypeScript | .ts, .tsx |
import |
//, /* */ |
| Java | .java |
import |
//, /* */ |
| C# | .cs |
using |
//, /* */ |
๐ ๏ธ Installation
๐ Usage
Analyze Project
Global Inspection
Show exact code fragments repeated across different files:
Strip Comments
โ๏ธ Configuration
Sweet resolves .swtrc files hierarchically.
๐ค Contributing
Contributions are welcome! Whether it's adding support for a new language, fixing a bug, or improving the documentation, please check our Contributing Guide to get started.
๐ License
Licensed under the MIT License.