code-analysis
Provides methodologies, metrics, and best practices for analyzing code structure, complexity, and quality
npx skills add majiayu000/claude-skill-registry --skill code-analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
## Overview This skill provides comprehensive knowledge for code analysis including complexity metrics, anti-pattern detection, refactoring strategies, and code quality assessment across multiple programming languages. ## Complexity Metrics ### Cyclomatic Complexity - **Low**: 1-10 (simple, easy to test) - **Medium**: 11-20 (moderate complexity, acceptable) - **High**: 21-50 (complex, needs refactoring) - **Very High**: 51+ (critical, must refactor) ### Cognitive Complexity Measures how difficult code is to understand based on nesting, control flow breaks, and recursion. ## Code Smells to Detect - **Long Methods**: >50 lines - **Large Classes**: >300 lines - **Duplicate Code**: Repeated blocks - **Long Parameter Lists**: >5 parameters - **Deep Nesting**: >4 levels - **God Objects**: Classes doing too much - **Dead Code**: Unused functions/variables ## Refactoring Strategies - **Extract Method**: Break long methods into smaller ones - **Extract Class**: Split large classes by responsibility - **Replace Conditional with Polymorphism** - **Simplify Conditional Expressions** - **Remove Duplicate Code** ## When to Apply Use when analyzing codebase structure, identifying refactoring oppo
- Overview
- Complexity Metrics
- Cyclomatic Complexity
- Cognitive Complexity
- Code Smells to Detect
- Refactoring Strategies
- When to Apply
What does the code-analysis skill do?
Provides methodologies, metrics, and best practices for analyzing code structure, complexity, and quality
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill code-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
