Skip to content
cccskills
FreePublished on GitHub

complexity-check

Find overly complex code: files over 300 lines, functions over 50 lines, deeply nested conditions (4+ levels), and magic numbers. Use for code quality reviews, pre-release checks, or when asked to assess code maintainability.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Check the codebase for complexity violations.

Changed files

!git diff --name-only HEAD~1 2>/dev/null || git diff --name-only origin/main...HEAD 2>/dev/null || echo "all"

Focus on the changed files listed above. If "all", check the entire codebase.

Check 1: Large files

Find source files over 300 lines (exclude node_modules, dist, .git, vendor, coverage, build):

find . \( -name "*.py" -o -name "*.ts" -o -name "*.js" -o -name "*.tsx" -o -name "*.jsx" -o -name "*.go" -o -name "*.rb" \) \
  -not -path "*/node_modules/*" \
  -not -path "*/dist/*" \
  -not -path "*/.git/*" \
  -not -path "*/vendor/*" \
  -not -path "*/coverage/*" \
  -not -path "*/build/*" \
  | xargs wc -l 2>/dev/null | sort -rn | head -20

Flag any file with more than 300 lines.

Check 2: Long functions

Read each changed source file (or sample the largest files if "all"). Scan for function or method definitions and estimate the line count between consecutive definitions. Flag any function that appears to span more than 50 lines.

Look for these definition patterns:

  • Python: def or async def
  • TypeScript/JavaScript: function , async function , => {, ): void {, ): Promise<
  • Go: func
  • Ruby: def

If a definition is followed by the next definition more than 50 lines later, flag the first function.

Check 3: Deep nesting

Search changed files for lines with 4 or more levels of indentation inside conditional or loop structures. Use these grep patterns (adjust for tab vs space indentation):

For 4-space indentation (16+ spaces):

grep -n "^                " <file>

For tab indentation (4+ tabs):

grep -n "^\t\t\t\t" <file>

Flag files where deeply nested lines appear inside if, for, while, or switch blocks.

Check 4: Magic numbers

Search changed files for numeric literals (other than 0, 1, -1, 2, 100, 1000) used directly in conditions or calculations without a named constant. Look for patterns like:

  • if x > 42:
  • * 3600
  • % 7 ==
  • timeout = 30

Exclude test files and configuration files where literal values are expected.

Output format

Output exactly:

COMPLEXITY FINDINGS:
- <file>:<line> — <description>

Examples:

COMPLEXITY FINDINGS:
- src/auth/handler.ts:1 — file is 412 lines (limit: 300)
- src/auth/handler.ts:87 — function processLogin is approximately 63 lines (limit: 50)
- src/utils/parser.py:145 — 5 levels of nesting detected
- src/config.ts:23 — magic number 86400 (consider: SECONDS_PER_DAY)

If no findings: output exactly COMPLEXITY FINDINGS: none

Do not add any prose before or after the findings block.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Write an Architecture Decision Record (ADR) document for a technical decision. Use when documenting a technical choice, architectural decision, or design decision.

The English summary is being prepared. Showing the original description.

davila7/claude-with-skills13Updated May 15, 2026

REST API design conventions for this codebase. Use when writing or reviewing API endpoints, route definitions, response formatting, or client code that calls the API.

The English summary is being prepared. Showing the original description.

davila7/claude-with-skills13Updated May 15, 2026

Automatically format code files after every edit using Prettier and ESLint. Active in the background whenever Claude edits a file. Formatting is silent — no prompts, no output unless a formatter fails. Use when you want consistent formatting enforced automatically during a coding session.

The English summary is being prepared. Showing the original description.

davila7/claude-with-skills13Updated May 15, 2026

Create a git branch named after a GitHub issue.

The English summary is being prepared. Showing the original description.

davila7/claude-with-skills13Updated May 15, 2026

Draft the changelog entry for all unreleased commits in Keep a Changelog format. Groups commits into Added, Changed, Fixed, Removed, and Security. Use before releasing a new version or when updating CHANGELOG.md.

The English summary is being prepared. Showing the original description.

davila7/claude-with-skills13Updated May 15, 2026

Draft a CHANGELOG.md entry for the current changes in Keep a Changelog format. Use when releasing, tagging a version, or updating CHANGELOG.md.

The English summary is being prepared. Showing the original description.

davila7/claude-with-skills13Updated May 15, 2026

See all skills by davila7

Report a problem with this skill