返回顶部
c

code-metrics

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
93
下载量
0
收藏
概述
安装方式
版本历史

code-metrics

# Code Metrics Analyze code quality and complexity metrics across your project. Supports 17+ languages. ## Quick Start ```bash # 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 ``` ## Metrics Provided - **Lines of Code** — total, code, comments, blank lines per language - **Comment-to-code ratio** — overall documentation density - **Function & class counts** — per language - **Cyclomatic complexity** — per-function for Python files (AST-based) - **Largest files** — top N files ranked by code lines - **High complexity warnings** — flags functions with complexity ≥5 ## Complexity Scale (Python) | Range | Risk | Meaning | |-------|------|---------| | 1-4 | 🟢 Low | Simple, well-structured | | 5-9 | 🟢 Moderate | Acceptable | | 10-14 | 🟡 High | Consider refactoring | | 15+ | 🔴 Very High | Refactor strongly recommended | ## Dependencies - Python 3.8+ (stdlib only, no pip packages needed)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 code-metrics-1776050888 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 code-metrics-1776050888 技能

通过命令行安装

skillhub install code-metrics-1776050888

下载 Zip 包

⬇ 下载 code-metrics v1.0.0

文件大小: 5.03 KB | 发布时间: 2026-4-14 14:44

v1.0.0 最新 2026-4-14 14:44
Initial release of code-metrics.

- Analyze code quality metrics across 17+ programming languages.
- Reports lines of code, comment ratios, function/class counts, and largest files.
- Measures cyclomatic complexity for Python (with per-function details and warnings).
- Offers JSON output, directory exclusion, and complexity analysis toggling.
- Requires only Python 3.8+ with no external dependencies.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部