.. _too-many-branches:

too-many-branches / R0912
=========================

**Message emitted:**

Too many branches (%s/%s)

**Description:**

*Used when a function or method has too many branches, making it hard to follow.*

**Problematic code:**

.. literalinclude:: /data/messages/t/too-many-branches/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/t/too-many-branches/good.py
   :language: python



Created by the `design <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/design_analysis.py>`__ checker.