Inspections are built-in static code analysis tools that help you find probable bugs, locate dead code, detect performance issues and improve the overall code structure.
Find the detailed description in the Code Inspections section; this page gives a brief outline.
In this section:
- On-the-fly code analysis
- Navigate to the next/previous problem
- Run project-wide inspections
- Suppress warnings
- Run a single inspection
- Highlighting level and power save mode
- Inspection profiles
On-the-fly code analysis
Most of the inspections run on-the-fly and display warnings or errors in the editor immediately as you type.
Inspections that are too complex to be run on on-the-fly are available when you perform code analysis for the entire project via, or when you run certain inspection by its name via .
Navigate to the next/previous problem
Editor lets you quickly navigate between the highlighted problems via keyboard shortcuts. Press F2 to go to the next problem and Shift+F2 to the previous one. You can configure severity of problems through which F2/Shift+F2 navigate, in the Editor page of the Settings dialog, and tell it, for example, to always jump to the most serious issue in a file.
Run project-wide inspections
To get complete report with the inspection results for an entire project, use the Inspection tool window:command. Explore the inspection results in the
Most inspections not only tell you where a problem is, but provide quick fixes to deal with them right away. Just press Alt+Enter and choose a quick fix.
When you don’t want warnings from this or that inspection for a specific statement or method, you can simply suppress them by pressing the right arrow on a quick-fix. Sometimes it may be a better solution than disabling the inspection for an entire project.
Run a single inspection
To run a single inspection by its name just press Ctrl+Shift+Alt+I or choose Running Inspection by Name for details.. Refer to the section
Highlighting level and power save mode
Another useful thing is the Hector icon , located on the Status bar. It helps you switch highlighting levels: from none to syntax and inspections. At syntax level you don't get any warnings except when code can't be compiled.
Hector also lets you activate power save mode that helps conserve battery power by disabling highlighting and auto-popups.
And finally you can change the list of inspections enabled for a project by managing the inspection profiles via the Inspections page of the Settings dialog. If you want to share your inspection profile with your team, enable Share profile check box and submit inspections project files into VCS.