complexity
代码复杂度指南,使用策略模式或调度表将环路复杂度控制在6以下。在编写或重构具有复杂分支逻辑的函数时使用。
📖 中文导读:代码复杂度指南,使用策略模式或调度表将环路复杂度控制在6以下。在编写或重构具有复杂分支逻辑的函数时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: complexity description: 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.
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