Filters
The Filters service is the default Sonar homepage when accessing a Sonar web server. The goal of this service is to answer to a maximum number of questions without any need to drilldown to secondary pages. Here are the common use cases covered by this service :
- List my favourite projects
- List the worst projects from the desired perspectives : technical debt, code coverage, duplications, ...
- List the modules of a project
- List the most complex files
- List the most longest unit test files
- ...
From there, you can click on any resource to drilldown to this resource.
"My favourites" tab
This tab is displayed only when a user is logged into Sonar and list all resources, whatever they are projects, modules, packages or files, that have been flagged as favourite by the user :

A resource can be flagged as favourite by simply clicking on a star icon available in the "Dashboard" and "Components" pages :

"Projects" tab
This tab is available and displayed by default for all Sonar users on any new Sonar instance. As expected, this page displays all available projects. This table as any other tables can be sorted by clicking on a column header.
Creating a new filter
Creating a filter requires to be logged in and then to click on the "Add filter" button :

A creation filter form can then be filled :

Here the list of available fields :
Field name |
Description |
Mandatory |
Advanced |
|---|---|---|---|
Name |
Name of the filter. |
|
|
Shared |
This option is only available for user with global admin role. Those administrators can share some filters with all Sonar users . |
|
|
Path |
Filter mechanism to display only resources sharing a root path. |
|
|
Type |
Filter mechanism to display only resources having a given type. |
|
|
Criteria |
Filter mechanism to display only resources whose a given measure is greater than or less than a threshold. Three criteria can be defined. |
|
|
Language |
Filter mechanism to display only resources from a given language |
|
|
Favourites only |
Filter mechanism to display only favourites |
|
|
Resource key like |
Filter mechanism to display only resources whose key matches a given pattern |
|
|
Resource name like |
Filter mechanism to display only resources whose name matches a given pattern |
|
|
Build date |
Filter mechanism to display only resources according to their last build date |
|
|
Once a filter has been defined, two actions are available :
- "Save & Close" : to save the current filter and come back to the "view" mode
- "Save & Display" : to save the current filter, stay in the "edit" mode, customize the "Display" and start seeing the filter result.

Editing a filter
Once a filter has been created, it can be edited at anytime by clicking on the "Edit filter" button :

Managing filters
Once several filters has been created, the need can appears to be able to order those filters in the Sonar web interface, to quickly delete some of them, to follow some shared filters, etc ...
Those features are available by clicking on the "Manage filters" button :


