rmc-complexity

Prioritize Rust refactoring by identifying complexity hotspots and estimating blast radius.

29|5|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/molaco/rust-code-mcp --skill rmc-complexity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rmc-complexity
Source: https://github.com/molaco/rust-code-mcp/tree/main/skills/rmc-complexity
Command: npx skills add https://github.com/molaco/rust-code-mcp --skill rmc-complexity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you locate and prioritize gnarly Rust code by measuring cyclomatic complexity and then estimating how widely the impact of refactoring will propagate.

Core Features & Use Cases

  • Complexity triage (file-level): Uses file aggregates like total cyclomatic, average per function, and function-call counts to quickly identify likely hot files.
  • Hot function discovery (structural): Uses call-graph structure to identify dispatch-like functions with high out-degree inside a hot file.
  • Blast-radius prioritization: Estimates impact via usage summaries and can be refined with workspace-level caller recursion counts.

Quick Start

Ask for a workspace or crate complexity ranking by providing the crate name or a file path hint as an argument, then follow the suggested triage-to-validate workflow.

Frequently Asked Questions about rmc-complexity

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

FAQPage Schema
How do I prioritize Rust code refactoring by blast radius?

You can prioritize Rust refactoring by measuring file-level cyclomatic complexity to find hotspots, then estimating blast radius via call graph structure and usage summaries. This workflow highlights high-complexity functions with the widest structural impact across the workspace.

What is cyclomatic complexity analysis used for in Rust workspaces?

Cyclomatic complexity analysis in Rust workspaces triages large files and discovers gnarly code by aggregating total complexity and average per function. It identifies likely hot files that serve as primary candidates for targeted structural refactoring.

How do I find high-complexity Rust functions using a call graph?

Find high-complexity Rust functions by first identifying hot files via complexity aggregates, then inspecting the call graph structure for dispatch-like functions with high out-degree. This pinpoints heavily connected functions within the most complex files.

Does this complexity analysis tool work with a single Rust crate or only full workspaces?

This complexity analysis supports both a single Rust crate and a full workspace. Provide a crate name or file path hint as an argument to generate a complexity ranking and estimate the structural blast radius for your specific scope.

What's the best way to verify before and after complexity changes in Rust?

The best way to verify before and after complexity changes in Rust is by using snapshots. Capture initial file-level cyclomatic aggregates, perform your refactoring, then compare the new metrics to validate that the structural complexity has actually decreased.

How does call graph indexing work for Rust blast radius estimation?

Call graph indexing for Rust blast radius estimation requires using build_hypergraph to ensure proper structural mapping. Once indexed, combine this with usage summaries and caller recursion counts to accurately estimate how widely a refactoring impact will propagate.