# JsonRepairHelper

- File ID: file:1dyqnkg:jsonrepairhelper-cs
- Path: NexusReader.Infrastructure/Helpers/JsonRepairHelper.cs
- Role: unknown
- Layer: infrastructure

## Purpose

Utility that attempts to repair truncated or malformed JSON strings by pruning trailing garbage and appending necessary closing quotes/brackets/braces.

## Key Details

Repairs truncated JSON by pruning trailing garbage and using a stack-based scan that respects quoted strings and escape sequences; returns original input unchanged when it already ends with a closing brace/bracket or is blank.

## Symbols

- JsonRepairHelper: Utility that attempts to repair truncated or malformed JSON strings by pruning trailing garbage and appending necessary closing quotes/brackets/braces.
- Repair(): Inspect a JSON string and attempt to repair common truncation/malformed scenarios by trimming, pruning trailing garbage, and appending missing closing characters.
- JsonRepairHelper: Static helper class that contains JSON repair utilities.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Coverage

- Symbols: 3
- Executable symbols: 1
- Executable symbols with control flow: 1
- Grounded edges: 3
- Unresolved references: 0
- Control-flow fragments: 1
- Unresolved jumps: 0
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 3

## Control Flow Fragments

- Repair: 96 nodes, 118 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### JsonRepairHelper Neighborhood

```mermaid
flowchart LR
    class_ogoid1_jsonrepairhelper("JsonRepairHelper")
    file_1dyqnkg_jsonrepairhelper_cs("JsonRepairHelper")
    method_1diht7t_repair[["Repair()"]]
    type_awil0x_jsonrepairhelper[/"JsonRepairHelper"/]
```

### JsonRepairHelper Execution Overview

```mermaid
flowchart TD
    class_ogoid1_jsonrepairhelper("JsonRepairHelper")
    method_1diht7t_repair[["Repair()"]]
    class_ogoid1_jsonrepairhelper -->|contains| method_1diht7t_repair
```

### Repair() Control Flow

_Warnings: diagram method_1diht7t_repair__fragment_diagram exceeds preferred complexity thresholds (96 nodes, 118 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1diht7t_repair__action_10_guard_clause_10__condition{"string.IsNullOrWhiteSpace(json)"}
    method_1diht7t_repair__action_10_guard_clause_10__false("continue")
    method_1diht7t_repair__action_10_guard_clause_10__merge("merge")
    method_1diht7t_repair__action_10_guard_clause_10__true("return-original")
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__condition{"string.IsNullOrWhiteSpace(json)"}
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__false("continue")
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__merge("merge")
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__true("exit")
    method_1diht7t_repair__action_11_transformation_11__linear("Trim input")
    method_1diht7t_repair__action_14_branch_14__condition{"not EndsWith('}') and not EndsWith(']')"}
    method_1diht7t_repair__action_14_branch_14__false("no-repair-needed")
    method_1diht7t_repair__action_14_branch_14__merge("merge")
    method_1diht7t_repair__action_14_branch_14__true("attempt-repair")
    method_1diht7t_repair__action_14_repair_branch_14_1__condition{"!json.EndsWith(\\"}\\") && !json.EndsWith(\\"]\\")"}
    method_1diht7t_repair__action_14_repair_branch_14_1__false("false")
    method_1diht7t_repair__action_14_repair_branch_14_1__merge("merge")
    method_1diht7t_repair__action_14_repair_branch_14_1__true("true")
    method_1diht7t_repair__action_18_extraction_18__linear("Locate last plausible cut point")
    method_1diht7t_repair__action_24_guard_clause_24__condition{"cutoff > 0"}
    method_1diht7t_repair__action_24_guard_clause_24__false("skip-pruning")
    method_1diht7t_repair__action_24_guard_clause_24__merge("merge")
    method_1diht7t_repair__action_24_guard_clause_24__true("prune-garbage")
    method_1diht7t_repair__action_24_repair_branch_24_2__condition{"cutoff > 0"}
    method_1diht7t_repair__action_24_repair_branch_24_2__false("false")
    method_1diht7t_repair__action_24_repair_branch_24_2__merge("merge")
    method_1diht7t_repair__action_24_repair_branch_24_2__true("true")
    method_1diht7t_repair__action_31_state_init_31__linear("Prepare stack and string/escape state")
    method_1diht7t_repair__action_35_loop_35__loop_body[["foreach char: handle escape toggling (line 37-38), toggle inString on '\\"' (line 39), skip content inside strings (line 40), push '{'/'[' (line 42), and match/pop on '}'/']' (lines 43-51). This implements bracket matching for unclosed structures."]]
    method_1diht7t_repair__action_35_loop_35__loop_entry("Iterate characters to rebuild structural stack")
    method_1diht7t_repair__action_35_loop_35__loop_exit("exit loop")
    method_1diht7t_repair__action_35_repair_loop_35_3__loop_body[["foreach (char c in json)"]]
    method_1diht7t_repair__action_35_repair_loop_35_3__loop_entry("char c in json")
    method_1diht7t_repair__action_35_repair_loop_35_3__loop_exit("Leaves the loop when the condition no longer holds.")
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__condition{"escaped"}
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__false("continue")
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__merge("merge")
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__true("exit")
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__condition{"c == '\\'"}
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__false("continue")
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__merge("merge")
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__true("exit")
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__condition{"c == '\\"'"}
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__false("continue")
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__merge("merge")
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__true("exit")
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__condition{"inString"}
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__false("continue")
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__merge("merge")
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__true("exit")
    method_1diht7t_repair__action_42_repair_branch_42_8__condition{"c == '{' || c == '[') stack.Push(c"}
    method_1diht7t_repair__action_42_repair_branch_42_8__false("false")
    method_1diht7t_repair__action_42_repair_branch_42_8__merge("merge")
    method_1diht7t_repair__action_42_repair_branch_42_8__true("true")
    method_1diht7t_repair__action_43_repair_branch_43_9__condition{"c == '}' || c == ']'"}
    method_1diht7t_repair__action_43_repair_branch_43_9__false("false")
    method_1diht7t_repair__action_43_repair_branch_43_9__merge("merge")
    method_1diht7t_repair__action_43_repair_branch_43_9__true("true")
    method_1diht7t_repair__action_43_repair_fallback_43_10__condition{"Falls back to alternate path"}
    method_1diht7t_repair__action_43_repair_fallback_43_10__false("otherwise")
    method_1diht7t_repair__action_43_repair_fallback_43_10__merge("merge")
    method_1diht7t_repair__action_43_repair_fallback_43_10__true("fallback")
    method_1diht7t_repair__action_45_repair_branch_45_11__condition{"stack.Count > 0"}
    method_1diht7t_repair__action_45_repair_branch_45_11__false("false")
    method_1diht7t_repair__action_45_repair_branch_45_11__merge("merge")
    method_1diht7t_repair__action_45_repair_branch_45_11__true("true")
    method_1diht7t_repair__action_48_repair_branch_48_12__condition{"(c == '}' && last == '{') || (c == ']' && last == '[')"}
    method_1diht7t_repair__action_48_repair_branch_48_12__false("false")
    method_1diht7t_repair__action_48_repair_branch_48_12__merge("merge")
    method_1diht7t_repair__action_48_repair_branch_48_12__true("true")
    method_1diht7t_repair__action_55_repair_branch_55_13__condition{"inString) builder.Append('\\"'"}
    method_1diht7t_repair__action_55_repair_branch_55_13__false("false")
    method_1diht7t_repair__action_55_repair_branch_55_13__merge("merge")
    method_1diht7t_repair__action_55_repair_branch_55_13__true("true")
    method_1diht7t_repair__action_55_state_based_action_55__linear("Handle unterminated string")
    method_1diht7t_repair__action_57_loop_57__loop_body[["While stack not empty, pop and append '}' for '{' and ']' for '[' (lines 57-62)"]]
    method_1diht7t_repair__action_57_loop_57__loop_entry("Append closing characters for remaining open brackets/braces")
    method_1diht7t_repair__action_57_loop_57__loop_exit("exit loop")
    method_1diht7t_repair__action_57_repair_loop_57_14__loop_body[["while (stack.Count > 0)"]]
    method_1diht7t_repair__action_57_repair_loop_57_14__loop_entry("stack.Count > 0")
    method_1diht7t_repair__action_57_repair_loop_57_14__loop_exit("Leaves the loop when the condition no longer holds.")
    method_1diht7t_repair__action_60_repair_branch_60_15__condition{"c == '{') builder.Append(\\"}\\""}
    method_1diht7t_repair__action_60_repair_branch_60_15__false("false")
    method_1diht7t_repair__action_60_repair_branch_60_15__merge("merge")
    method_1diht7t_repair__action_60_repair_branch_60_15__true("true")
    method_1diht7t_repair__action_61_repair_branch_61_16__condition{"c == '[') builder.Append(\\"]\\""}
    method_1diht7t_repair__action_61_repair_branch_61_16__false("false")
    method_1diht7t_repair__action_61_repair_branch_61_16__merge("merge")
    method_1diht7t_repair__action_61_repair_branch_61_16__true("true")
    method_1diht7t_repair__action_61_repair_fallback_61_17__condition{"Falls back to alternate path"}
    method_1diht7t_repair__action_61_repair_fallback_61_17__false("otherwise")
    method_1diht7t_repair__action_61_repair_fallback_61_17__merge("merge")
    method_1diht7t_repair__action_61_repair_fallback_61_17__true("fallback")
    method_1diht7t_repair__entry(["Repair entry"])
    method_1diht7t_repair__action_64_repair_return_64_18__return(["Returns result"])
    method_1diht7t_repair__action_64_return_64__return(["Return repaired JSON"])
    method_1diht7t_repair__action_67_repair_return_67_19__return(["Returns result"])
    method_1diht7t_repair__action_10_guard_clause_10__condition -->|continue| method_1diht7t_repair__action_10_guard_clause_10__false
    method_1diht7t_repair__action_10_guard_clause_10__condition -->|return-original| method_1diht7t_repair__action_10_guard_clause_10__true
    method_1diht7t_repair__action_10_guard_clause_10__false -->|next| method_1diht7t_repair__action_10_guard_clause_10__merge
    method_1diht7t_repair__action_10_guard_clause_10__merge -->|next| method_1diht7t_repair__action_10_repair_guard_clause_10_0__condition
    method_1diht7t_repair__action_10_guard_clause_10__true -->|next| method_1diht7t_repair__action_10_guard_clause_10__merge
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__condition -->|continue| method_1diht7t_repair__action_10_repair_guard_clause_10_0__false
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__condition -->|exit| method_1diht7t_repair__action_10_repair_guard_clause_10_0__true
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__false -->|next| method_1diht7t_repair__action_10_repair_guard_clause_10_0__merge
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__merge -->|next| method_1diht7t_repair__action_11_transformation_11__linear
    method_1diht7t_repair__action_10_repair_guard_clause_10_0__true -->|next| method_1diht7t_repair__action_10_repair_guard_clause_10_0__merge
    method_1diht7t_repair__action_11_transformation_11__linear -->|next| method_1diht7t_repair__action_14_repair_branch_14_1__condition
    method_1diht7t_repair__action_14_branch_14__condition -->|no-repair-needed| method_1diht7t_repair__action_14_branch_14__false
    method_1diht7t_repair__action_14_branch_14__condition -->|attempt-repair| method_1diht7t_repair__action_14_branch_14__true
    method_1diht7t_repair__action_14_branch_14__false -->|next| method_1diht7t_repair__action_14_branch_14__merge
    method_1diht7t_repair__action_14_branch_14__merge -->|next| method_1diht7t_repair__action_18_extraction_18__linear
    method_1diht7t_repair__action_14_branch_14__true -->|next| method_1diht7t_repair__action_14_branch_14__merge
    method_1diht7t_repair__action_14_repair_branch_14_1__condition -->|false| method_1diht7t_repair__action_14_repair_branch_14_1__false
    method_1diht7t_repair__action_14_repair_branch_14_1__condition -->|true| method_1diht7t_repair__action_14_repair_branch_14_1__true
    method_1diht7t_repair__action_14_repair_branch_14_1__false -->|next| method_1diht7t_repair__action_14_repair_branch_14_1__merge
    method_1diht7t_repair__action_14_repair_branch_14_1__merge -->|next| method_1diht7t_repair__action_14_branch_14__condition
    method_1diht7t_repair__action_14_repair_branch_14_1__true -->|next| method_1diht7t_repair__action_14_repair_branch_14_1__merge
    method_1diht7t_repair__action_18_extraction_18__linear -->|next| method_1diht7t_repair__action_24_guard_clause_24__condition
    method_1diht7t_repair__action_24_guard_clause_24__condition -->|skip-pruning| method_1diht7t_repair__action_24_guard_clause_24__false
    method_1diht7t_repair__action_24_guard_clause_24__condition -->|prune-garbage| method_1diht7t_repair__action_24_guard_clause_24__true
    method_1diht7t_repair__action_24_guard_clause_24__false -->|next| method_1diht7t_repair__action_24_guard_clause_24__merge
    method_1diht7t_repair__action_24_guard_clause_24__merge -->|next| method_1diht7t_repair__action_24_repair_branch_24_2__condition
    method_1diht7t_repair__action_24_guard_clause_24__true -->|next| method_1diht7t_repair__action_24_guard_clause_24__merge
    method_1diht7t_repair__action_24_repair_branch_24_2__condition -->|false| method_1diht7t_repair__action_24_repair_branch_24_2__false
    method_1diht7t_repair__action_24_repair_branch_24_2__condition -->|true| method_1diht7t_repair__action_24_repair_branch_24_2__true
    method_1diht7t_repair__action_24_repair_branch_24_2__false -->|next| method_1diht7t_repair__action_24_repair_branch_24_2__merge
    method_1diht7t_repair__action_24_repair_branch_24_2__merge -->|next| method_1diht7t_repair__action_31_state_init_31__linear
    method_1diht7t_repair__action_24_repair_branch_24_2__true -->|next| method_1diht7t_repair__action_24_repair_branch_24_2__merge
    method_1diht7t_repair__action_31_state_init_31__linear -->|next| method_1diht7t_repair__action_35_repair_loop_35_3__loop_entry
    method_1diht7t_repair__action_35_loop_35__loop_body -->|continue| method_1diht7t_repair__action_35_loop_35__loop_entry
    method_1diht7t_repair__action_35_loop_35__loop_entry -->|iterate| method_1diht7t_repair__action_35_loop_35__loop_body
    method_1diht7t_repair__action_35_loop_35__loop_entry -->|exit| method_1diht7t_repair__action_35_loop_35__loop_exit
    method_1diht7t_repair__action_35_loop_35__loop_exit -->|next| method_1diht7t_repair__action_37_repair_guard_clause_37_4__condition
    method_1diht7t_repair__action_35_repair_loop_35_3__loop_body -->|continue| method_1diht7t_repair__action_35_repair_loop_35_3__loop_entry
    method_1diht7t_repair__action_35_repair_loop_35_3__loop_entry -->|char c in json| method_1diht7t_repair__action_35_repair_loop_35_3__loop_body
    method_1diht7t_repair__action_35_repair_loop_35_3__loop_entry -->|Leaves the loop when the condition no longer holds.| method_1diht7t_repair__action_35_repair_loop_35_3__loop_exit
    method_1diht7t_repair__action_35_repair_loop_35_3__loop_exit -->|next| method_1diht7t_repair__action_35_loop_35__loop_entry
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__condition -->|continue| method_1diht7t_repair__action_37_repair_guard_clause_37_4__false
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__condition -->|exit| method_1diht7t_repair__action_37_repair_guard_clause_37_4__true
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__false -->|next| method_1diht7t_repair__action_37_repair_guard_clause_37_4__merge
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__merge -->|next| method_1diht7t_repair__action_38_repair_guard_clause_38_5__condition
    method_1diht7t_repair__action_37_repair_guard_clause_37_4__true -->|next| method_1diht7t_repair__action_37_repair_guard_clause_37_4__merge
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__condition -->|continue| method_1diht7t_repair__action_38_repair_guard_clause_38_5__false
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__condition -->|exit| method_1diht7t_repair__action_38_repair_guard_clause_38_5__true
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__false -->|next| method_1diht7t_repair__action_38_repair_guard_clause_38_5__merge
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__merge -->|next| method_1diht7t_repair__action_39_repair_guard_clause_39_6__condition
    method_1diht7t_repair__action_38_repair_guard_clause_38_5__true -->|next| method_1diht7t_repair__action_38_repair_guard_clause_38_5__merge
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__condition -->|continue| method_1diht7t_repair__action_39_repair_guard_clause_39_6__false
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__condition -->|exit| method_1diht7t_repair__action_39_repair_guard_clause_39_6__true
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__false -->|next| method_1diht7t_repair__action_39_repair_guard_clause_39_6__merge
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__merge -->|next| method_1diht7t_repair__action_40_repair_guard_clause_40_7__condition
    method_1diht7t_repair__action_39_repair_guard_clause_39_6__true -->|next| method_1diht7t_repair__action_39_repair_guard_clause_39_6__merge
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__condition -->|continue| method_1diht7t_repair__action_40_repair_guard_clause_40_7__false
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__condition -->|exit| method_1diht7t_repair__action_40_repair_guard_clause_40_7__true
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__false -->|next| method_1diht7t_repair__action_40_repair_guard_clause_40_7__merge
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__merge -->|next| method_1diht7t_repair__action_42_repair_branch_42_8__condition
    method_1diht7t_repair__action_40_repair_guard_clause_40_7__true -->|next| method_1diht7t_repair__action_40_repair_guard_clause_40_7__merge
    method_1diht7t_repair__action_42_repair_branch_42_8__condition -->|false| method_1diht7t_repair__action_42_repair_branch_42_8__false
    method_1diht7t_repair__action_42_repair_branch_42_8__condition -->|true| method_1diht7t_repair__action_42_repair_branch_42_8__true
    method_1diht7t_repair__action_42_repair_branch_42_8__false -->|next| method_1diht7t_repair__action_42_repair_branch_42_8__merge
    method_1diht7t_repair__action_42_repair_branch_42_8__merge -->|fallback| method_1diht7t_repair__action_43_repair_fallback_43_10__condition
    method_1diht7t_repair__action_42_repair_branch_42_8__true -->|next| method_1diht7t_repair__action_42_repair_branch_42_8__merge
    method_1diht7t_repair__action_43_repair_branch_43_9__condition -->|false| method_1diht7t_repair__action_43_repair_branch_43_9__false
    method_1diht7t_repair__action_43_repair_branch_43_9__condition -->|true| method_1diht7t_repair__action_43_repair_branch_43_9__true
    method_1diht7t_repair__action_43_repair_branch_43_9__false -->|next| method_1diht7t_repair__action_43_repair_branch_43_9__merge
    method_1diht7t_repair__action_43_repair_branch_43_9__merge -->|next| method_1diht7t_repair__action_45_repair_branch_45_11__condition
    method_1diht7t_repair__action_43_repair_branch_43_9__true -->|next| method_1diht7t_repair__action_43_repair_branch_43_9__merge
    method_1diht7t_repair__action_43_repair_fallback_43_10__condition -->|otherwise| method_1diht7t_repair__action_43_repair_fallback_43_10__false
    method_1diht7t_repair__action_43_repair_fallback_43_10__condition -->|fallback| method_1diht7t_repair__action_43_repair_fallback_43_10__true
    method_1diht7t_repair__action_43_repair_fallback_43_10__false -->|next| method_1diht7t_repair__action_43_repair_fallback_43_10__merge
    method_1diht7t_repair__action_43_repair_fallback_43_10__merge -->|next| method_1diht7t_repair__action_43_repair_branch_43_9__condition
    method_1diht7t_repair__action_43_repair_fallback_43_10__true -->|next| method_1diht7t_repair__action_43_repair_fallback_43_10__merge
    method_1diht7t_repair__action_45_repair_branch_45_11__condition -->|false| method_1diht7t_repair__action_45_repair_branch_45_11__false
    method_1diht7t_repair__action_45_repair_branch_45_11__condition -->|true| method_1diht7t_repair__action_45_repair_branch_45_11__true
    method_1diht7t_repair__action_45_repair_branch_45_11__false -->|next| method_1diht7t_repair__action_45_repair_branch_45_11__merge
    method_1diht7t_repair__action_45_repair_branch_45_11__merge -->|next| method_1diht7t_repair__action_48_repair_branch_48_12__condition
    method_1diht7t_repair__action_45_repair_branch_45_11__true -->|next| method_1diht7t_repair__action_45_repair_branch_45_11__merge
    method_1diht7t_repair__action_48_repair_branch_48_12__condition -->|false| method_1diht7t_repair__action_48_repair_branch_48_12__false
    method_1diht7t_repair__action_48_repair_branch_48_12__condition -->|true| method_1diht7t_repair__action_48_repair_branch_48_12__true
    method_1diht7t_repair__action_48_repair_branch_48_12__false -->|next| method_1diht7t_repair__action_48_repair_branch_48_12__merge
    method_1diht7t_repair__action_48_repair_branch_48_12__merge -->|next| method_1diht7t_repair__action_55_state_based_action_55__linear
    method_1diht7t_repair__action_48_repair_branch_48_12__true -->|next| method_1diht7t_repair__action_48_repair_branch_48_12__merge
    method_1diht7t_repair__action_55_repair_branch_55_13__condition -->|false| method_1diht7t_repair__action_55_repair_branch_55_13__false
    method_1diht7t_repair__action_55_repair_branch_55_13__condition -->|true| method_1diht7t_repair__action_55_repair_branch_55_13__true
    method_1diht7t_repair__action_55_repair_branch_55_13__false -->|next| method_1diht7t_repair__action_55_repair_branch_55_13__merge
    method_1diht7t_repair__action_55_repair_branch_55_13__merge -->|next| method_1diht7t_repair__action_57_repair_loop_57_14__loop_entry
    method_1diht7t_repair__action_55_repair_branch_55_13__true -->|next| method_1diht7t_repair__action_55_repair_branch_55_13__merge
    method_1diht7t_repair__action_55_state_based_action_55__linear -->|next| method_1diht7t_repair__action_55_repair_branch_55_13__condition
    method_1diht7t_repair__action_57_loop_57__loop_body -->|continue| method_1diht7t_repair__action_57_loop_57__loop_entry
    method_1diht7t_repair__action_57_loop_57__loop_entry -->|iterate| method_1diht7t_repair__action_57_loop_57__loop_body
    method_1diht7t_repair__action_57_loop_57__loop_entry -->|exit| method_1diht7t_repair__action_57_loop_57__loop_exit
    method_1diht7t_repair__action_57_loop_57__loop_exit -->|next| method_1diht7t_repair__action_60_repair_branch_60_15__condition
    method_1diht7t_repair__action_57_repair_loop_57_14__loop_body -->|continue| method_1diht7t_repair__action_57_repair_loop_57_14__loop_entry
    method_1diht7t_repair__action_57_repair_loop_57_14__loop_entry -->|stack.Count > 0| method_1diht7t_repair__action_57_repair_loop_57_14__loop_body
    method_1diht7t_repair__action_57_repair_loop_57_14__loop_entry -->|Leaves the loop when the condition no longer holds.| method_1diht7t_repair__action_57_repair_loop_57_14__loop_exit
    method_1diht7t_repair__action_57_repair_loop_57_14__loop_exit -->|next| method_1diht7t_repair__action_57_loop_57__loop_entry
    method_1diht7t_repair__action_60_repair_branch_60_15__condition -->|false| method_1diht7t_repair__action_60_repair_branch_60_15__false
    method_1diht7t_repair__action_60_repair_branch_60_15__condition -->|true| method_1diht7t_repair__action_60_repair_branch_60_15__true
    method_1diht7t_repair__action_60_repair_branch_60_15__false -->|next| method_1diht7t_repair__action_60_repair_branch_60_15__merge
    method_1diht7t_repair__action_60_repair_branch_60_15__merge -->|fallback| method_1diht7t_repair__action_61_repair_fallback_61_17__condition
    method_1diht7t_repair__action_60_repair_branch_60_15__true -->|next| method_1diht7t_repair__action_60_repair_branch_60_15__merge
    method_1diht7t_repair__action_61_repair_branch_61_16__condition -->|false| method_1diht7t_repair__action_61_repair_branch_61_16__false
    method_1diht7t_repair__action_61_repair_branch_61_16__condition -->|true| method_1diht7t_repair__action_61_repair_branch_61_16__true
    method_1diht7t_repair__action_61_repair_branch_61_16__false -->|next| method_1diht7t_repair__action_61_repair_branch_61_16__merge
    method_1diht7t_repair__action_61_repair_branch_61_16__merge -->|return| method_1diht7t_repair__action_64_repair_return_64_18__return
    method_1diht7t_repair__action_61_repair_branch_61_16__true -->|next| method_1diht7t_repair__action_61_repair_branch_61_16__merge
    method_1diht7t_repair__action_61_repair_fallback_61_17__condition -->|otherwise| method_1diht7t_repair__action_61_repair_fallback_61_17__false
    method_1diht7t_repair__action_61_repair_fallback_61_17__condition -->|fallback| method_1diht7t_repair__action_61_repair_fallback_61_17__true
    method_1diht7t_repair__action_61_repair_fallback_61_17__false -->|next| method_1diht7t_repair__action_61_repair_fallback_61_17__merge
    method_1diht7t_repair__action_61_repair_fallback_61_17__merge -->|next| method_1diht7t_repair__action_61_repair_branch_61_16__condition
    method_1diht7t_repair__action_61_repair_fallback_61_17__true -->|next| method_1diht7t_repair__action_61_repair_fallback_61_17__merge
    method_1diht7t_repair__action_64_repair_return_64_18__return -->|return| method_1diht7t_repair__action_64_return_64__return
    method_1diht7t_repair__action_64_return_64__return -->|return| method_1diht7t_repair__action_67_repair_return_67_19__return
    method_1diht7t_repair__entry -->|next| method_1diht7t_repair__action_10_guard_clause_10__condition
```

## Diagram Validation

- Status: warn
- Warning: control-flow: diagram method_1diht7t_repair__fragment_diagram exceeds preferred complexity thresholds (96 nodes, 118 edges).
