Although code analysis is performed on-the-fly in all open files, you may want to run it for the whole project or a custom scope and examine the results in a friendly view.
Run a code inspection
Open the desired file in the editor. Alternatively select files or directories in the Project Tool Window. For multiple selection, click the items holding down the Ctrl/⌘ key. The initial inspection scope will be confined to the opened file or the selection.
To run an inspection for the currently opened file, or the file(s)/folder(s) selected in the Project view, select the File/Module <name> option.
To apply inspect code in a specific scope, select the Custom scope option, then choose the desired scope from the list or click Browse and configure a new scope in the Scopes dialog.
To have test source files inspected too, select the Include test sources checkbox.
Rather than running all enabled inspections, CLion makes it possible to exactly specify the desired inspection by its name and run it to inspect the code in the specific scope.
Run inspection by name
Open the desired file in the editor. Alternatively select files or directories in the Project Tool Window. For multiple selection, click the items holding down the Ctrl/⌘ key. The initial inspection scope will be confined to the opened file or the selection.
On the main menu, choose Code | Run Inspection by Name, or press Ctrl+Shift+Alt+I.
In the pop-up frame that opens, start typing the inspection name. As you type, the suggestion list shrinks to show the matching inspection only.
If you are not sure that you are selecting the correct inspection, you can view its description. To do so, select an inspection in the popup and press Ctrl+Q.
To run an inspection for the currently opened file, or the file(s)/folder(s) selected in the Project view, select the File/Module <name> option.
To apply inspect code in a specific scope, select the Custom scope option, then choose the desired scope from the list or click Browse and configure a new scope in the Scopes dialog.
To have test source files inspected too, select the Include test sources checkbox.
To apply inspection only in files matching the specific mask, select the File Masks(s) and specify the file mask. Use comma to separate multiple file masks.