Code inspection report.


I would like to ask if I can somehow run the inspection code from the command line and get the report as a file? XML or even plain file?

I have a big project that I need to clean and if I could generate such a report every now and then, it would really help me. Maybe copy code inspection to TeamCity?

Best regards.


Please look here
(We'll update WS/PS docs later)

As for TeamCity - it has built-in inspection runner for all inspections available in IDEA Ultimate, so you need to just provide your inspection profile to Inspection build runner.


FYI, are you aware that those webhelp pages don't work in IE9, unless I turn Compatability View on?


I was sooo excited to see this, but here is the batch files it says to run:

@echo off
call idea.bat inspect %*

idea.bat does not exist in that folder. Should it?

Also, what is inspect_diff.bat?


Grzegorz Drozd,

Does idea.bat exist in your \bin folder (or are you on Linux, and if so, does the file exist)?


well, replace with IDENAME.bat

basically commandline is
IDE.exe inspect "AllOtherOptionsAsDescribedInHelp"


Nope. There are way too much browsers nowadays as for me. Anyway, I forwarded your request to appropriate department.


I'm confused when I run inspect.bat like this:

inspect.bat C:\inetpub\Intranet_Local\.idea\Intranet_Local.iml C:\inetpub\Intranet_Local\.idea\inspectionProfiles\Critical.xml c:\result.xml -v2

I get this:

Starting up JetBrains PhpStorm 2.1.2 ...done.
Opening project...[   2414]  ERROR - spection.InspectionApplication - null
at com.intellij.codeInspection.InspectionApplication.a(InspectionApplica
at com.intellij.codeInspection.InspectionApplication.access$200(Inspecti
at com.intellij.codeInspection.InspectionApplication$
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(A
at com.intellij.codeInspection.InspectionApplication.startup(InspectionA
at com.intellij.codeInspection.InspectionMain.main(
at com.intellij.idea.MainImpl$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$000(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(
[   2415]  ERROR - spection.InspectionApplication - JetBrains PhpStorm 2.1.2  Bu
ild #PS-107.425
[   2416]  ERROR - spection.InspectionApplication - JDK: 1.6.0_24
[   2416]  ERROR - spection.InspectionApplication - VM: Java HotSpot(TM) Client
[   2416]  ERROR - spection.InspectionApplication - Vendor: Sun Microsystems Inc
[   2416]  ERROR - spection.InspectionApplication - OS: Windows 7
[   2416]  ERROR - spection.InspectionApplication - Last Action:

But you are saying to run it like this?

C:\Program Files (x86)\PHPStorm\bin>PhpStorm.exe inspect C:\inetpub\Intranet_Local\.idea\Intranet_Local.iml C:\inetpub\Intranet_Local\.idea\inspectionProfiles\Critical.xml c:\result.xml -v2


well judging the contents of the bat file this is essentially the same.

As for the error - it might be just broken in current build (almost nobody uses it).
I'll investigate it a bit..


I imagine, but we've been wanting something like this for some time. I was so excited to see your response to his post. I never saw that feature added.


Its a part of the IDEA and the platform and is used there and by TeamCity for running automated Inspection bulds on your project on the separate agents.
Inspections can run for 12 hours for a huge project.. Also TC provides a diff - i.e. lists all NEW problems for a build (which can be run per check in or daily or...)


Please sign in to leave a comment.