learn-claude-code's agent layer carries highest activity risk — 5 functions to address

Two _loop god-functions in the agents/ layer dominate shareAI-lab/learn-claude-code's risk profile, combining cyclomatic complexity above 38 with live commit activity and fan-out above 20.

Stephen Collins ·
oss typescript refactoring code-health

Antipatterns Detected

exit_heavy 5 complex_branching 3 god_function 3 long_function 3 deeply_nested 2

Top pattern: exit_heavy

Key Points

What is a god function and why does it matter in learn-claude-code?

A god function is one that handles too many responsibilities at once, accumulating logic that would be better distributed across smaller, focused functions. In learn-claude-code, the _loop functions in the agents layer are flagged as god functions with fan-outs of 29 and 20 respectively — meaning a single change there can ripple through dozens of downstream call targets. This concentration of logic makes bugs harder to isolate and refactoring harder to scope safely.

How do I reduce cyclomatic complexity in TypeScript?

Extract each major conditional branch into a named function with a clear single responsibility, replacing nested if/else chains with early returns or strategy objects. This lowers the number of independent paths through any one function and makes each path independently testable.

Is learn-claude-code actively maintained?

The top five hotspots all sit in the fire quadrant, meaning they combine high structural complexity with high recent commit activity — the _loop function in agents/s_full.py alone carries a recent activity score of 16.76. This is strong evidence of active, ongoing development in the agent layer at the time of commit a9c7100.

How do I reproduce this analysis?

Run the Hotspots CLI against the shareAI-lab/learn-claude-code repository at commit a9c7100 to reproduce the scores and rankings shown here.

What does activity-weighted risk mean?

Complexity × recent commit frequency — functions that are hard to understand AND actively changing are the highest priority for refactoring.

Explore every function analyzed

Enter your email to unlock — free, no spam.

We'll remember your email so you don't have to re-enter it on future analyses.

Pro $20 / mo

Full dataset + API access

Query any repo we've analysed. Export raw metrics. Integrate into your own tooling. Currently in waitlist — no billing yet.

Want this for your own codebase?

Hotspots runs locally in under a minute — no account, no data leaves your machine. Or submit your repo and we'll send you a report.

Related Analyses