Cyclomatic Complexity Refactorer
Refactors complex, deeply nested code into clean, readable, and maintainable functions by reducing cyclomatic complexity.
Cyclomatic Complexity is a specialized Claude Code skill designed to analyze, measure, and systematically refactor high-complexity code paths and branching logic into clean, human-maintainable functions. It integrates with industry-standard linters like radon, ESLint, gocyclo, and lizard to detect complexity hotspots, then applies proven refactoring patterns such as guard clauses, function extraction, lookup tables, and named predicates. The skill enforces strict safety rules—preserving existing behavior, respecting public APIs, and verifying test passes—while providing concise before-and-after complexity reports.
Key Features
01Preserves behavior and enforces test verification before and after refactoring
02376 GitHub stars
03Outputs structured before-and-after complexity scorecards for transparent review
04Measures cyclomatic complexity across languages using tools like radon, ESLint, gocyclo, and lizard
05Applies prioritized refactoring tactics including early returns, function extractions, and lookup tables
06Prevents metric gaming by prioritizing readable, single-responsibility functions over dense one-liners
Use Cases
01Sanitizing heavily branched AI-generated code before opening a pull request
02Refactoring monolithic god functions and deeply nested branching into modular components
03Fixing complexity linting violations enforced by CI/CD pipelines