Analyze Branching

Formally analyzes control-flow branchings, cyclomatic complexity, nesting depths, and branch redundancies across Python and TypeScript engine files.

dealfluence d57f693 1.1 KB Updated

File contents

Analyze Branching Skill

This skill provides formal analysis of control-flow branchings, decision points, and nesting depth across the Python (python/src/adeu/redline/engine.py) and TypeScript (node/packages/core/src/engine.ts) engine implementations.

Usage

Run the engine branch checker script from repository root:

uv run python scripts/check_engine_branches.py

Or analyze individual files:

Python Analysis

uv run python scripts/analyze_python_branches.py [path_to_file]

TypeScript Analysis

node scripts/analyze_ts_branches.mjs [path_to_file]

Metrics

  • Cyclomatic Complexity: Counts decision nodes (if, elif/else, loops, exception handlers, logical boolean operators and/or / &&/||, conditional expressions).
  • Max Depth: Deepest nesting level of control flow structures inside a single function.
  • Deep Nesting Warning: Flags functions with branch nesting levels $\ge 6$.

dealfluence/adeu/tree/main/.opencode/skills/analyze-branching commit d57f693404

Frequently asked questions

npx skillmds@latest add dealfluence/analyze-branching