.. _exceptions-unthrown: .. _unthrown-exception: Unthrown Exception ++++++++++++++++++ These exceptions are defined in the code but never thrown. They are probably dead code. Unused exceptions are code bloat, as they increase the size of the code without any purpose. They are also misleading, as other developers might come to the impression that there is a mechanism to handle the situation that the `exception `_ describe, yet they are generating a fatal `error `_. .. code-block:: php Connex PHP features ------------------- + `exception `_ Suggestions ___________ * Remove the exception * Find a place in the code to throw the exception * Replace an existing \Exception with this more specific one Specs _____ +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Exceptions/Unthrown | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior `, :ref:`Dead code ` | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | ClearPHP | `no-unthrown-exceptions `__ | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------+