complexity-analyzer

Analyze cyclomatic and cognitive complexity in JavaScript and Python functions.

29|7|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/armanzeroeight/fastagent-plugins --skill complexity-analyzer-armanzeroeight
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: complexity-analyzer
Source: https://github.com/armanzeroeight/fastagent-plugins/tree/main/plugins/code-quality-toolkit/skills/complexity-analyzer
Command: npx skills add https://github.com/armanzeroeight/fastagent-plugins --skill complexity-analyzer-armanzeroeight

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers identify and refactor overly complex functions in their codebase, leading to more maintainable and understandable software.

Core Features & Use Cases

  • Cyclomatic Complexity Analysis: Quantifies the number of independent paths through a function.
  • Cognitive Complexity Analysis: Measures how difficult a function is for a human to understand.
  • Refactoring Guidance: Provides strategies like "Extract Method" and "Replace Nested Conditionals" to simplify code.
  • Use Case: Before merging a large feature, use this Skill to scan the new code for functions exceeding a complexity threshold, ensuring code quality.

Quick Start

Analyze the complexity of all JavaScript files in the 'src/' directory using the complexity-analyzer skill.

Frequently Asked Questions about complexity-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure cognitive and cyclomatic complexity to find functions that need refactoring?

Code complexity analysis identifies overly complex functions by quantifying independent execution paths for cyclomatic complexity and evaluating human readability for cognitive complexity based on nesting depth and non-linear control flow.

What is the best way to scan JavaScript and Python code for high complexity before a merge?

The best way to scan JavaScript and Python code for high complexity before a merge is to analyze the source directory to identify functions exceeding a complexity threshold, ensuring maintainability and triggering necessary refactoring strategies.

Does complexity analysis provide specific refactoring strategies for nested conditionals?

Yes, complexity analysis provides specific refactoring strategies for nested conditionals by recommending actionable techniques like Extract Method and Replace Nested Conditionals to simplify non-linear control flow and reduce decision points.

Can I use a complexity analyzer to measure the maintainability of my entire src directory?

Yes, you can use a complexity analyzer to measure the maintainability of your src directory by scanning all supported JavaScript and Python files to pinpoint overly complex functions requiring simplification across the codebase.

What is the difference between cognitive complexity and cyclomatic complexity when evaluating code quality?

The difference between cognitive and cyclomatic complexity in code quality is that cyclomatic complexity quantifies the number of independent paths through a function, while cognitive complexity measures how difficult a function is for a human to understand.