quality-complexity-check

Analyze Python and Mojo code for complexity metrics and refactoring needs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? This Skill automatically analyzes code complexity metrics like cyclomatic complexity and nesting depth, helping developers pinpoint areas that are hard to understand, test, or maintain, and guiding refactoring efforts. It automates code analysis, reducing manual review time.

Core Features & Use Cases:

  • Complexity Metrics: Provides cyclomatic complexity, nesting depth, and function length reports to highlight problematic code.
  • Refactoring Guidance: Identifies functions and modules that exceed complexity thresholds, suggesting candidates for simplification.
  • Use Case: During a code review, use this skill to generate a complexity report. If a function has a cyclomatic complexity of 25, you know it's a prime candidate for refactoring into simpler, more manageable units, improving maintainability.

Quick Start: Use the quality-complexity-check skill to analyze the complexity of the Python code in the current directory.

Frequently Asked Questions about quality-complexity-check

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

FAQPage Schema
How do I identify complex code that needs refactoring?

Cyclomatic complexity metrics identify complex code by measuring decision points in functions. The quality-complexity-check skill analyzes Python and Mojo codebases to report complexity scores, nesting depth, and function length, flagging code exceeding thresholds as refactoring candidates.

Can I use complexity analysis during code reviews?

Yes. Generate a complexity report during code review to pinpoint problematic functions before merge. The skill enforces complexity thresholds and provides refactoring guidance, reducing manual analysis time and improving maintainability decisions.

What code metrics does complexity analysis measure?

Complexity analysis measures cyclomatic complexity, nesting depth, and function length. These metrics reveal code that is hard to understand, test, or maintain, helping teams prioritize refactoring efforts and maintain code quality standards.

Does this work with Python and Mojo codebases?

Yes. The quality-complexity-check skill applies to both Python and Mojo codebases during code reviews, pre-release checks, and ongoing maintenance workflows, automating complexity detection across your repository.

How do I know if a function is too complex to maintain?

Functions exceeding cyclomatic complexity thresholds—like a complexity score of 25—signal maintenance risk and become prime refactoring candidates. The skill's detailed reports guide you toward simplification strategies and more testable code units.

What happens when code exceeds complexity thresholds?

When code exceeds set complexity thresholds, the skill generates a detailed report identifying specific functions and modules for refactoring. It provides actionable guidance to break down complex logic into simpler, more maintainable components.