code-complexity-scanner
Installation
SKILL.md
Code Complexity Scanner
Overview
This skill analyzes source code to measure cyclomatic complexity, cognitive complexity, and function length. It identifies the most complex functions and files in a codebase, helping teams focus refactoring efforts on the code that's hardest to maintain and most likely to harbor bugs.
Instructions
Step 1: Identify Target Language and Files
Detect the primary language from file extensions and package files. Filter to source code only (exclude node_modules, vendor, dist, build, pycache, .git).
Step 2: Measure Cyclomatic Complexity
For each function/method, count:
if,elif/else if→ +1 eachfor,while,do-while→ +1 eachcasein switch (each case) → +1 eachcatch→ +1
Related skills