IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Run code inspections from the command line

Last modified: 30 June 2021

IntelliJ IDEA runs code inspections to find and highlight syntax errors, dead code, possible bugs, bad coding style, and other problems. You can also run all the configured inspections for a specific project from the command line and store the results as an XML, JSON, or plain text file with a report.

The command-line inspector launches an instance of IntelliJ IDEA in the background where it runs the inspections. It will not work if another instance of IntelliJ IDEA is already running. In this case, you can use inspections in the running instance. Use the command-line inspector for automated regular code analysis of large projects with many contributors.

You can find the executable for running IntelliJ IDEA in the installation directory under bin. To use this executable as the command-line launcher, add it to your system PATH as described in Command-line interface.

Syntax
idea64.exe inspect <project> <inspection-profile> <output> [<options>]

note

Use idea.exe for 32-bit versions of Windows.

Example

Inspect the C:\MyProject\src directory of the C:\MyProject project using the C:\MyProject\.idea\inspectionProfiles\MyProfile.xml profile with maximum verbosity, and save results to an XML file under C:\MyProject\InspectionResults:

>
idea64.exe inspect C:\MyProject C:\MyProject\.idea\inspectionProfiles\MyProfile.xml C:\MyProject\InspectionResults -v2 -d C:\MyProject\src