Skip to content
Back to skills

Complexity Report

ASecurity

Reports cyclomatic complexity hotspots and refactoring suggestions

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added June 1, 2026
ai-agentsbashrefactoringapi

Works with

  • api

Security analysis

A100/100

Scanned June 1, 2026

npx -y skills add berkcangumusisik/claude-code-practices --skill complexity-report --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Complexity Report?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Complexity Report
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/berkcangumusisik-complexity-report/badge)](https://www.skillsdirectory.com/skills/berkcangumusisik-complexity-report)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: complexity-report
description: Reports cyclomatic complexity hotspots and refactoring suggestions
argument-hint: [directory]
user-invocable: true
allowed-tools: Bash Grep Read
effort: medium
---

## Complexity Report

Directory: **$1** (or `src/` if not specified)

1. Find complex functions manually (no external tool needed):
```bash
# Functions longer than 50 lines
grep -n "^function \|^  [a-z].*(.*) {" ${1:-src}/**/*.ts 2>/dev/null | head -30
```

Read the top 10 largest files and functions.

2. For each file over 300 lines or function over 40 lines:
   - Count the number of if/else/switch/for/while/try blocks (= cyclomatic complexity)
   - Note the nesting depth
   - Identify the "complexity source"

3. Rank by complexity and report:

```
Top 5 Complexity Hotspots:
  src/auth/middleware.ts:handleRequest()   CC: 18  Lines: 87
  src/api/router.ts:routeRequest()         CC: 14  Lines: 120
  ...

Refactoring recommendations:
  1. handleRequest() - extract 3 auth validation blocks into separate functions
  2. ...
```

4. Offer to refactor the top offender.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…