20

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?

6
  • 2
    How about Analyze -> Inspect Code...? Commented Jun 23, 2015 at 17:23
  • 1
    Inspect Code... with option only changed files makes something similar, but the view of the results is different. Commented Jun 23, 2015 at 17:40
  • 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 Commented Jun 24, 2015 at 10:29
  • 7
    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. Commented Nov 5, 2017 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. Commented Jul 25, 2018 at 18:45

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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
2

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.