Inspectopedia 2024.3 Help

Unreachable code

Reports unreachable statements inside SQL routines.

Example (Microsoft SQL Server):

CREATE FUNCTION foo() RETURNS INT AS BEGIN THROW; RETURN 1; END;

In Microsoft SQL Server, the THROW statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH construct. Therefore, the RETURN 1; part will never be executed.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

SqlUnreachable
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | SQL

Last modified: 03 December 2024