Skip to content
Agentmart
Submit a tool

code-complexity

Use when writing or reviewing functions, for guidance on parameter counts, nesting depth, function length, and single-responsibility structure.

Skill by ioncache

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ioncache-code-complexity

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when writing or reviewing functions, for guidance on parameter counts, nesting depth, function length, and single-responsibility structure.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/code-complexity

What's inside

Skill name
code-complexity
Description
Use when writing or reviewing functions, for guidance on parameter counts, nesting depth, function length, and single-responsibility structure.
License
MIT
Instructions
90 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Code Complexity Guidelines

## Core Principles

1. Functions should be small, focused, and do one thing well
2. Prefer readability over strict metrics
3. Functions should be pure when possible
4. Avoid side effects and global state dependencies

## Hard Limits

- **Max 3 parameters**, use an object parameter for more than 3 params or
  boolean flags
- **Max 3 nesting levels**, use early returns and guard clauses
- **Target under 30 lines per function**, longer is fine if cohesive and clear
- **Target cyclomatic complexity under 15**, higher is fine if the logic is
  simple and related

## Key Patterns

**Use early returns to reduce nesting:**

```javascript
// Bad: Deep nesting
function process(order) {
  if (order.isValid) {
    if (order.items.length > 0) {
      if (order.customer.isActive) {
        return doWork(order)
      }
    }
  }
  return null
}

// Good: Guard clauses
function process(order) {
  if (!order.isValid) {
    return null
  }
  if (order.items.length === 0) {
    return null
  }
  if (!order.customer.isActive) {
    return null
  }
  return doWork(order)
}
```

**Use object parameters for related data:**

```javascript
// Bad: Too many params
function createUser(name, email, age, address, phone) {}

// Good: Grouped params
function createUser(userData) {
  const { name, email, age, address, phone } = userData
}
```

**Extract complex logic into focused functions:**

```javascript
// Bad: Multiple responsibilities
function processUserData(user) {
  validateUser(user)
  updateDatabase(user)
  sendWelcomeEmail(user)
  createUserProfile(user)
}

// Good: Composed from smaller functions
function processUserData(user) {
  validateUser(user)
  const dbUser = updateDatabase(user)
  notifyUser(dbUser)
}
```

## Review Checklist

- [ ] Single responsibility
- [ ] 3 or fewer parameters
- [ ] 3 or fewer nesting levels
- [ ] Clear, descriptive names
- [ ] No global state dependencies

From ioncache/ioncache-ai-tools, MIT.

More from ioncache/ioncache-ai-tools

Signals

Stars
0
Forks
0
Open issues
3
Last commit (this folder)
Jul 29, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ioncache

Cite this page

code-complexity skill. Agent Mart. https://agentmart.dev/skills/ioncache-code-complexity (last updated 2026-10-24)