quality-complexity-check

Analyze cyclomatic complexity, nesting depth, and function length in Python and Mojo codebases.

18|5|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/HomericIntelligence/ProjectOdyssey --skill quality-complexity-check-homericintelligence
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: quality-complexity-check
Source: https://github.com/HomericIntelligence/ProjectOdyssey/tree/main/.claude/skills/quality-complexity-check
Command: npx skills add https://github.com/HomericIntelligence/ProjectOdyssey --skill quality-complexity-check-homericintelligence

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps identify and refactor complex code sections, improving maintainability and reducing the likelihood of bugs.

Core Features & Use Cases

  • Code Complexity Analysis: Measures cyclomatic complexity, nesting depth, and function length.
  • Refactoring Guidance: Provides patterns and workflows for improving code structure.
  • Use Case: During a code review, use this Skill to flag functions with high cyclomatic complexity, suggesting specific refactoring techniques like "Extract Function" to make the code more manageable.

Quick Start

Run the check_complexity.py script to analyze the current codebase.

Frequently Asked Questions about quality-complexity-check

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

FAQPage Schema
How do I check cyclomatic complexity and nesting depth in my Python codebase?

Cyclomatic complexity analysis measures code complexity metrics like nesting depth and function length to identify areas needing refactoring. It helps reduce bugs and improve maintainability by flagging complex functions during code reviews.

What is cyclomatic complexity and when should I refactor complex functions?

Cyclomatic complexity measures the number of linearly independent paths through source code. You should refactor complex functions when analysis flags high nesting depth or excessive function length, applying patterns like Extract Function to simplify code structure.

Does this code complexity analysis tool support Mojo codebases?

Yes, this code complexity analysis tool supports Mojo codebases alongside Python through dedicated scripts. It analyzes cyclomatic complexity, nesting depth, and function length to provide actionable refactoring guidance for both programming environments.

What's the best way to identify code that needs refactoring during a code review?

The best way to identify code needing refactoring during a code review is to run complexity analysis scripts that measure cyclomatic complexity, nesting depth, and function length, then use the provided refactoring patterns to target the most complex functions.

How do I use refactoring patterns to reduce code complexity?

To use refactoring patterns for reducing code complexity, run the complexity analysis to identify flagged functions, then apply suggested techniques like Extract Function to break down high cyclomatic complexity and deep nesting into manageable, maintainable code.