name: code-metrics description: Analyze code quality metrics including lines of code by language, cyclomatic complexity (Python), function/class counts, comment ratios, and largest file rankings. Use when asked to analyze code quality, count lines of code, measure complexity, find the biggest files, get a project overview, or audit code metrics across a codebase. Supports Python, JavaScript, TypeScript, Go, Rust, Ruby, Java, C/C++, C#, Swift, Kotlin, PHP, Shell, Lua, R, and Scala.
Analyze code quality and complexity metrics across your project. Supports 17+ languages.
# Analyze current project python3 scripts/code_metrics.py # Analyze specific directory python3 scripts/code_metrics.py /path/to/project # JSON output python3 scripts/code_metrics.py --json # Skip complexity analysis (faster) python3 scripts/code_metrics.py --no-complexity # Exclude additional directories python3 scripts/code_metrics.py --exclude migrations fixtures小蔥技能站7w4.net發現了升級外掛。
| Range | Risk | Meaning |
|---|---|---|
| 1-4 | 🟢 Low | Simple, well-structured |
| 5-9 | 🟢 Moderate | Acceptable |
| 10-14 | 🟡 High | Consider refactoring |
| 15+ | 🔴 Very High | Refactor strongly recommended |
整體質量良好,程式碼簡潔高效,無需安裝額外依賴即可使用。該 Skill 覆蓋的語言型別豐富,能快速生成程式碼度量報告,包含程式碼行數、註釋比例、函式類數量和複雜度警告等實用資訊。文件說明詳細,上手容易。略有不足的是,部分高階語言的函式檢測依賴簡單的模式匹配,在複雜程式碼場景下可能存在誤差,但日常使用完全足夠。