Perform code analysis in IntelliJ IDEA

17,829

Solution 1

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.

Solution 2

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

Share:
17,829

Related videos on Youtube

duffy356
Author by

duffy356

I am software developer in Austria. Currently I work on Java Enterprise applications.

Updated on June 26, 2022

Comments

  • duffy356
    duffy356 almost 2 years

    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?

    • maba
      maba almost 9 years
      How about Analyze -> Inspect Code...?
    • Mike Nakis
      Mike Nakis over 6 years
      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.
    • Gary
      Gary almost 6 years
      I agree @MikeNakis This distinction has been a pet peeve of mine for years. They seem almost the same, but not quite.
    • duffy356
      duffy356
      Inspect Code... with option only changed files makes something similar, but the view of the results is different.
  • Gary
    Gary almost 6 years
    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