> For the complete documentation index, see [llms.txt](https://fsm2.onepub.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fsm2.onepub.dev/debugging-your-fsm/static-analysis.md).

# Static Analysis

FSM2 is able to perform a static analysis on your state machine. The static analysis tool is able to detect a number of issues with your FSM including:

* States which cannot be reached
* Duplicate States
* Events which target an non-registered state.

To perform a static analysis I usually set up a unit tests. This allows me to manually run the static analysis with a single click on the unit test.

```dart
  test('export', () async {
    final machine = _createMachine();
    await machine.analyse();
  });
```

##
