In PhpStorm, there is a set of code inspections that detect and correct abnormal code in your project. 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. PhpStorm 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. For
the complete list of code inspections available in PhpStorm, refer to Code inspection index. In the Settings/Preferences dialog
(Ctrl+Alt+S), go to . You can also press
Ctrl+Alt+Shift+H and select Configure Inspections in the popup that opens. Use
to filter the inspections list. For example, you can filter inspections by severity or by language. Last modified: 01 August 2022 PhpStorm analyses code in files that are opened in the editor and highlights anomalous code as you type. To quickly see the results of the instant analysis, take a look at the icon in the top-right corner of the editor. If an error is detected, you will see . The The color stripe in the scrollbar also marks detected code problems and helps you quickly access the corresponding code strings without scrolling the file. Hover over a mark on the stripe to see the detected problem in a tooltip. Click a mark to jump to the corresponding code string. You can navigate from one highlighted string to another in the editor within a file by pressing F2 (to go to the next problem) and Shift+F2 (to return to the previous one). For the majority of code problems, PhpStorm provides quick-fixes that you can see and apply by pressing Alt+Enter. Run inspections manuallySome inspections require global code analysis, and that is why they are disabled in the editor. These inspections are listed in . Click and select Show Only Batch-Mode Inspections. If you want to get a full report of all detected anomalous code strings, run inspections explicitly. Run all inspections
Run a single inspectionRunning a single inspection is useful in case you want to track a specific problem. If you find a warning in a file, you can inspect your entire project, or the necessary scope of files, to ensure that there are no more such warnings in your code base.
The IDE will show you the inspection results in the dedicated tool window. There you can examine and fix detected problems. Run inspections offlineIn addition to running code inspections from the IDE, you can launch inspections from the command line without actually running PhpStorm. The inspection results will be stored in an XML file. For more information, refer to Launching Code Inspection from Command Line. Change the order of scopesBy default, all enabled code inspections analyze all files in your project. Depending on your needs, you can run the same inspection in more than one scope of files with different settings. If one file is included in two or more scopes, and you enable an inspection in these scopes, PhpStorm will process them according to their order in the list of scopes — the uppermost scope will have the highest priority, and therefore, it will be analyzed first.
Last modified: 29 November 2019 What do you mean by code inspection?Code inspection is a verification technique that evaluates the precision of the code within the product. Comprehending the importance and steps of code inspection can allow you to build a quality software product that satisfies the client and engages consumers.
Where is analyze in Intellij?From the main menu, select Code | Analyze Code | Dependencies. Alternatively, if you want to analyze a specific item, right-click it in the Project tool window and select Analyze | Analyze Dependencies. In the dialog that opens, specify the scope of files that you want to analyze.
|