Code inspections
Open settings by pressing CtrlAlt0S and navigate to Editor | Inspections.
In DataGrip, there is a set of code inspections that detect and correct abnormal code in your project before you compile it. The IDE can find and highlight various problems, locate dead code, find probable bugs, spelling problems, and improve the overall code structure.
Inspections can scan your code in all project files or only in specific scopes (for example, only in production code or in modified files).
Every inspection has a severity level — the extent to which a problem can affect your code. Severities are highlighted differently in the editor so that you can quickly distinguish between critical problems and less important things. DataGrip comes with a set of predefined severity levels and enables you to create your own.
Inspections and their settings are grouped in profiles. Each profile contains the information on the enabled inspections, a scope of files that they analyze, and their severity levels.
The following video gives a short overview of inspections and how they work.
note
In the video, the DataGrip user interface is Classic UI. Starting from version 2023.1, the New UI is available. For more information about the New UI, refer to the corresponding topic.
For the complete list of code inspections available in DataGrip, refer to Inspections in DataGrip.
In the Settings dialog (CtrlAlt0S) , go to Editor | Inspections.
You can also press CtrlAltShift0H and select Configure Inspections in the popup that opens.
Use to filter the inspection list. For example, you can filter inspections by severity or by language.
note
Select the Disable new inspections by default checkbox to disable new inspections that come from installed plugins as they may affect the configuration of your inspection profile.
To see the list of available inspections, open settings CtrlAlt0S and navigate to Editor | Inspections.
Detects an unused item in the subquery (for example, a field).
If you forgot to put the WHERE
or WHERE TRUE
clause in DELETE
and UPDATE
statements, DataGrip displays a notification to remind you about that.
When you run the statements, DataGrip shows you the warning. If you omitted the WHERE
or WHERE TRUE
clause intentionally, you can execute current statements as you planned by clicking Execute in the warning.
Thanks for your feedback!