IntelliJ IDEA 14.0.0 Web Help

Configuring Inspection Severities

In this section:

Basics

Inspection severity indicates how seriously the code issues detected by the inspection impact the project and determines how the detected issues should be highlighted in the editor. By default, each inspection has one of the following severity levels:

  • Server problem server_problem
  • Typo typo
  • Info info
  • Weak Warning info
  • Warning warning
  • Error error

You can increase or decrease the severity level of each inspection. That is, you can force IntelliJ IDEA to display some warnings as errors or weak warnings. In a similar way, what is initially considered a weak warning can be displayed as a warning or error, or just as info.

You can also configure the color and font style used to highlight each severity level. Besides, you can create custom severity levels and set them for specific inspections.

If necessary, you can set different severity levels for the same inspection in different scopes.

All modifications to inspections mentioned above are saved in the inspection profile currently selected in the inspection settings and apply when this profile is used.

Changing severity of an inspection

To change the severity of an inspection

  1. In the inspection settings, select the desired profile. The inspections associated with the profile are displayed in the tree view.
  2. Select the desired inspection. If this inspection is disabled, select the check box next to it.
  3. Select the desired severity from the context menu of the inspection or from the Severity selector on the right:
    severity_selector
  4. Apply changes. The modified inspection will now have the new severity level when this profile is used.

Changing highlighting style for specific severity level

To change highlighting style for specific severity level

  1. Do one of the following:
    • In the Settings dialog, select Editor | Colors & Fonts -> General , and then select the style corresponding to the desired severity level.
    • In the inspection settings, select the desired inspection and choose Edit severities from the Severity selector.
      OptionsArea

      Next, in the Severities Editor dialog box that opens, select the desired severity level and click Edit Settings | Colors & Fonts.

    Either way you will see the styles associated with this severity in the Colors and Fonts settings page.

  2. Configure the color and font styles as necessary and apply changes. The detected issues with the corresponding severity will now be highlighted in the editor with the modified style when the current profile is used.

Defining a custom severity level

To define a custom severity level

  1. In the inspection settings, select the desired inspection and choose Edit severities from the Severity selector.
    OptionsArea
    .
  2. In the Severities Editor dialog box that opens, click add.png:
    severity_editor
  3. Type the name for the new severity in the New Highlight Severity dialog box.
    severity_highlight

    The custom severity is added to the list of severities.

  4. Specify color and font settings for the new severity using the controls to the right of the list of severities.
  5. Use the Up arrowUp.png and Down arrowDown.png buttons to change the priority of the new severity.
  6. Apply changes. The new severity level will now be available for all inspections within the current profile. You can assign it to specific inspections and get the corresponding code issues highlighted with the specified style in the editor.

    If necessary, you can remove the custom severity level later by selecting it in the Severities Editor dialog box and clicking delete.png.

    You cannot change priorities of the pre-defined severity levels, or remove them.

See Also

Concepts:

Reference:

Web Resources:

Last modified: 4 December 2014
comments powered by Disqus