Skip to content
Back to skills

Code Complexity Analyzer

ASecurity

Analyze code complexity metrics including cyclomatic complexity, code smells, and technical debt

  • 1,760 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentsjavascriptjavabashrefactoringperformance

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add a5c-ai/babysitter --skill code-complexity-analyzer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Complexity Analyzer?

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

Security grade badge for Code Complexity Analyzer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a5c-ai-code-complexity-analyzer-babysitter/badge)](https://www.skillsdirectory.com/skills/a5c-ai-code-complexity-analyzer-babysitter)

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: code-complexity-analyzer
description: Analyze code complexity metrics including cyclomatic complexity, code smells, and technical debt
allowed-tools:
  - Bash
  - Read
  - Write
  - Glob
  - Grep
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:software-architecture]
  skillAreas: [skill-area:code-analysis-linting]
  roles: [role:tech-lead, role:principal-engineer]
  workflows: [workflow:technical-debt-reduction]
  topics: [topic:technical-debt, topic:refactoring]

---

# Code Complexity Analyzer Skill

## Overview

Analyzes code complexity metrics including cyclomatic complexity, cognitive complexity, code smells, duplicate code detection, and technical debt scoring.

## Capabilities

- Calculate cyclomatic complexity
- Calculate cognitive complexity
- Identify code smells
- Dependency analysis
- Duplicate code detection
- Technical debt scoring
- Maintainability index calculation
- Lines of code metrics

## Target Processes

- refactoring-plan
- performance-optimization
- system-design-review

## Input Schema

```json
{
  "type": "object",
  "required": ["paths"],
  "properties": {
    "paths": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Paths to analyze (supports glob patterns)"
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["cyclomatic", "cognitive", "loc", "dependencies", "duplicates", "maintainability"]
      },
      "default": ["cyclomatic", "cognitive", "loc"]
    },
    "thresholds": {
      "type": "object",
      "properties": {
        "cyclomatic": { "type": "number", "default": 10 },
        "cognitive": { "type": "number", "default": 15 },
        "duplicateLines": { "type": "number", "default": 6 }
      }
    },
    "languages": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Languages to analyze"
    }
  }
}
```

## Output Schema

```json
{
  "type": "object",
  "properties": {
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": { "type": "string" },
          "metrics": {
            "type": "object",
            "properties": {
              "cyclomatic": { "type": "number" },
              "cognitive": { "type": "number" },
              "loc": { "type": "number" },
              "maintainability": { "type": "number" }
            }
          },
          "violations": { "type": "array" }
        }
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "totalFiles": { "type": "number" },
        "averageComplexity": { "type": "number" },
        "technicalDebtScore": { "type": "number" },
        "hotspots": { "type": "array" }
      }
    },
    "duplicates": {
      "type": "array"
    }
  }
}
```

## Usage Example

```javascript
{
  kind: 'skill',
  skill: {
    name: 'code-complexity-analyzer',
    context: {
      paths: ['src/**/*.ts'],
      metrics: ['cyclomatic', 'cognitive', 'loc', 'dependencies'],
      thresholds: { cyclomatic: 10, cognitive: 15 }
    }
  }
}
```

Files in this skill

  • README.md399 B
  • SKILL.md3.1 KB

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…