# StateMachineDetector

**Kind:** Class

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/state-machine-detector.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/state-machine-detector.ts#L60)

State Machine Detector

## Methods

| Method | Signature | Returns |
|---|---|---|
| `detect` | `detect(entities: Entity[])` | `DetectedStateMachine[]` |
| `linkTransitions` | `linkTransitions(stateMachines: DetectedStateMachine[], entities: Entity[])` | `void` |

## Where it refuses work

- `StateMachineDetector` stops the work with an early return when `!isStatusEnum`.
- `StateMachineDetector` stops the work with an early return when `states.length < 2`.
- `StateMachineDetector` stops the work with an early return when `!code.includes('createMachine') && !code.includes('Machine(')`.
- `StateMachineDetector` stops the work with an early return when `states.length === 0`.
- `StateMachineDetector` stops the work with an early return when `funcMatch`.
- `StateMachineDetector` stops the work with an early return when `arrowMatch`.
