Calculate · Assess & Decide · Engineering
Cyclomatic complexity with refactor flags
McCabe cyclomatic complexity per function from its control-flow graph, with a refactor flag for any that exceed your threshold.
You receive: A reviewed complexity calculator + the passing test report, run on your control-flow graphs.
Part of Ship MVP
What's verified: STUD verifies the calculator computes McCabe cyclomatic complexity from each control-flow graph on held-out cases: M = edges - nodes + components (or + 2*components in the two-parameter mode), one row per graph in input order, flagged for refactor when M strictly exceeds your threshold. STUD does NOT derive the graph from real source code, nor judge whether a flagged function actually needs refactoring; it checks the arithmetic on the counts you provide.
Opens soon
This play is verified and ready. It opens soon, once sign-in and payments are live.
Example
A sample of what this play produces. Your result is generated for your inputs.
Rows
| Name | Complexity | Exceeds threshold |
|---|---|---|
| normalize_submission | 2 | false |
| grade_submission | 10 | false |
| sync_catalog_apply | 15 | true |
| render_intake_field | 3 | false |
Inputs
| Name | Edges | Nodes | Components |
|---|---|---|---|
| normalize_submission | 8 | 7 | 1 |
| grade_submission | 21 | 12 | 1 |
| sync_catalog_apply | 30 | 16 | 1 |
| render_intake_field | 12 | 10 | 1 |
Arithmetic recomputed against the tasks.py compute_cyclomatic_complexity oracle, 2026-08-08, one-parameter formula M = edges - nodes + components: normalize_submission 8 - 7 + 1 = 2, grade_submission 21 - 12 + 1 = 10 (exactly at the threshold of 10, not flagged, the refactor flag fires only when M strictly exceeds the threshold), sync_catalog_apply 30 - 16 + 1 = 15 (flagged to refactor), render_intake_field 12 - 10 + 1 = 3. Graph counts are illustrative example counts for functions in STUD's own judge and catalog code, in the order supplied; the calculator checks the arithmetic on the counts you provide, it does not derive the graphs from source.
Get early access to STUD the day it goes live.