# Complexity

> Code complexity guidelines to keep cyclomatic complexity below 6 using strategy patterns or dispatch tables. Use when writing or refactoring functions with complex branching logic.

- Skill: `majiayu000/complexity-4` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/complexity-4`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/complexity-4/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/majiayu000/complexity-4

---


# Code Complexity Guidelines

Apply these guidelines to keep code complexity manageable.

## Cyclomatic Complexity

Keep the cyclomatic complexity of each function below 6.

- If you have a large switch case, consider using the strategy pattern or dispatch table instead

