IntelliJ IDEA Code Inspection
Inspection is a static code analysis tool which helps us to find runtime errors, locate dead code, detect performance issue, memory leak, spelling problems and also improve the overall code structure. It does not only tell us about where is the problem in the code but also suggest the corrections right away. Code Inspection are available when we perform code analysis for -
By default, IntelliJ IDEA performs analysis on all open files. If an error is detected in the project then we will see the following icon in the top right side of the Editor -
Running Code Inspections
There are two ways to run Code Inspection -
1. Inspect Code
2. Run Inspection by Name
During Code Inspection, we can also tell IntelliJ IDEA about the type of problems we would like to search for and get reports about them. This action can be performed by the Inspection Profile. Inspection Profile can be applicable for both: the entire IDE or only for the specific project.