LGTM Enterprise 1.25

Alert filtering

In LGTM, you can use filters to narrow down the displayed alerts on the following locations of the user interface:

  • File browser—allowing users to explore project alerts further.
  • Alerts tab of the project page—containing a list of active alerts for a project.
  • My alerts page—containing a personalized list of alerts that may be of interest to you.

Filtering options

Use the query filters to narrow down the display to the alerts you are interested in. The available filter categories are:

  • Severity—query severity: error, warning or recommendation

    For the project Alerts page and the My Alerts page, you can also filter alerts by severity, by using the banner containing the alert breakdown. For more information, see Exploring project alerts and My alerts.

  • Query—query identifier
  • Tag—query tag (in LGTM, we assign tags to queries so that you can identify them and search for them easily)

How does filtering work?

Filtering works as follows:

  • An alert is shown if it matches all categories.
  • There is an alert match for a given category if:
    • No values are selected in that category, or
    • The alert matches at least one of the values selected in that category

The screenshot below is taken from the file browser but the principles are the same for the other locations.

Use the filter drop-down lists to choose what you want to filter on. Alternatively, search for values using Search ( below). The selected filters are shown in a section below the drop-downs ( below).

For each filter, you can reset selections by clicking the or the symbol adjacent to each individual value or for the whole filter ( below). Alternatively, click Clear selection ( below).

You can save and reuse filters. For more information, refer to Saving and reusing filters below.

Additional options

In addition to the query filters, other options are available to help you tweak the filtering further. The available options are as follows:

Page Option

File browser

Show excluded files—show or hide excluded files. For more details, see Using the file browser.

Show heatmap—show or hide the heatmap. The heatmap is shown by default.

Project alerts

Language—filter alerts by language.

Group by query—classify alerts by query. The queries are sorted by severity (error, warning, recommendation) first, then alphabetically on the query name.

My alerts

Project—filter alerts by project.

Suggested alerts—show or hide suggested alerts. The default is to show suggested alerts.

Group by query—classify alerts by query. The queries are sorted by severity (error, warning, recommendation) first, then alphabetically on the query name.

You can also export alerts to a SARIF file. For more details, see Exploring alerts as SARIF.

Saving and reusing filters

You can save alert filters, that is a combination of the query filter categories and other related options mentioned above, for future use.

Saving a filter

To save a filter:

  1. Select the appropriate options in the query filter categories and the nearby check boxes.
  2. Click ( below) underneath Alert filters to save the filter.
  3. Type a name for the filter in the Save as box ( below).
  4. Click the adjacent icon ( below) .
  5. The name of the saved filter appears in the box located below Alert filters, indicating that it's current.

Saving alert filters

Reusing a filter

To reuse an existing filter:

  1. Click the down arrow ( below) and choose a filter from the drop-down box.

    The Security filter is a built-in filter that you can use to display alerts that are errors or warnings highlighted by queries with a security tag.

    Reusing alert filters

  2. The page information is updated to match your selection. If the filter specifies any options that can't be applied to the current page these are ignored. For example, if you save a filter in the My alerts page with the Suggested alerts check box enabled, this option is ignored when you reuse this filter in the project Alerts page or the File browser, as it's not available on either of these two pages.

    Note that filter selection doesn't persist when you navigate to other pages. Just select the desired filter in the Alert filters drop-down box to re-apply your choice.

You can also perform the following actions on alert filters:

  • Clear the current filter—click ( above).
  • Delete a custom filter—click ( above).

Editing a filter

To edit/update a filter:

  1. Ensure that the filter is current, that is, it's selected in the box underneath Alert filters ( below).
  2. Edit the filter as appropriate. As soon as you make changes, an asterisk appears to the right of the filter name ( below), to indicate that there are unsaved changes.
  3. Click ( below) to save the filter.

    Editing alert filters

  4. Then, either:
    1. Click Update ( above) to update the current filter, or
    2. Type a new name in the Save as box ( above) to save it under a different name and click the adjacent icon.
    The existing filter has been updated, or saved under a new name.