19

When I start to commit changes to the VCS, the following commit dialog appears.

Screenshot of IntelliJ commit dialog

I checked the option 'Perform code analysis'. If I press commit, the code analysis starts, and when its finished i get the following dialog to view the results of the analysis:

Screenshot of Code Analysis Result

If I press the review button I can review the results.

I would like to start exactly the same analysis manually. My version of IntelliJ IDEA: 14.1.1 (built on March 31, 2015)

Is it possible to run code analysis of commit dialog without a commit in IntelliJ?

Matt
  • 74,352
  • 26
  • 153
  • 180
duffy356
  • 3,678
  • 3
  • 32
  • 47
  • 2
    How about `Analyze` -> `Inspect Code...`? – maba Jun 23 '15 at 17:23
  • 1
    `Inspect Code...` with option `only changed` files makes something similar, but the view of the results is different. – duffy356 Jun 23 '15 at 17:40
  • @duffy356: Please add solutions as answers, not as addendums to the question. – Matt Jun 28 '15 at 05:54
  • Are you trying to run inspection only on the changed files? If yes, *Analyze -> Inspect Code -> Custom Scope -> VCS Scopes -> Changed Files* or a Changeset of your choice – LIU ShouHai Jun 24 '15 at 10:29
  • 6
    this question was asked and accepted in 2015, but the answer provided is inadequate. Code inspection on commit yields far fewer warnings than manually triggered code inspection on uncommitted files. There is a difference, and it is entirely unclear why. – Mike Nakis Nov 05 '17 at 10:07
  • 1
    I agree @MikeNakis This distinction has been a pet peeve of mine for years. They seem almost the same, but not quite. – Gary Jul 25 '18 at 18:45

2 Answers2

12

Analyze -> Inspect Code (maba's answer) is correct.

You can specify the inspections profiles in the project settings. More Information on inspection profiles can be found here https://www.jetbrains.com/idea/documentation/static_code_analysis.html

You can also search for 3rd party plugins if your language/framework is not supported out of the box.

Johannes Ferner
  • 718
  • 7
  • 15
  • 9
    This doesn't seem to work for me. No matter what inspection profile is selected, I still can't seem to manually reproduce what the "perform code analysis" checkbox on commit does. The manual inspection run finds more issues- and often times not as useful - as the "perform code analysis" checkbox – Gary Jul 25 '18 at 18:49
2

In PhpStorm, code analyis option before commits can be turned off enter image description here

Mustapha GANGA
  • 505
  • 7
  • 12