Skip to end of metadata
Go to start of metadata

Table of Contents

The actions described on this page may only be performed by a Quality Profile administrator.

Creating a Profile

Profiles can be created Quality Profiles page. Profile names must be unique among profiles for that language. For some languages,  you may be able to provide configuration files for the external tools used during analysis in order to pre-populate the new quality profile with some existing rules configurations.

Copying a Profile

To copy an existing quality profile, click the Copy button at the top-right of the profile you want to copy.

You are prompted to give the name of the new profile. It must be unique among profile names for the language in question. The new profile is an exact copy of the original profile, including inheritance (parent) relationships. 

Renaming a Profile

Click on the Rename button. You are prompted to give the new name of the profile.

Renaming a profile will result in a Profile Change event being recorded on the next analysis of each project that uses the profile.

Backing up / Restoring a Profile

The profile backup mechanism downloads profile's rules to an XML file on your machine. It does not preserve project assignments and profile inheritance relationships, but inherited rules are included in the backup.

The backup/restore mechanism is useful for:

  • Promoting the coding rules in a quality profile from a staging environment to a production environment.
  • Sharing a quality profile with outsourced subcontractors who cannot access your SonarQube platform.

Click on the Back up link to export a quality profile as an XML file. To restore a quality profile, choose Restore Profile from the menu at the top-right of the profile list, and specify the XML file from which to restore.

Note that the profile you're importing must have a unique name for the language. That is, it must not already exist in the SonarQube instance where you're trying to import it.

Restoring Built-in Profiles

As explained previously, language plugins come with built-in profiles (usually named "Sonar way") so that you can get started quickly with SonarQube. Those profiles contain sets of rules that are considered non-controversial for the language. However:

  • it is possible to modify those profiles, and thus loose track of what the language plugins' basic set of good rules
  • once created, those profiles do not evolve when you upgrade the corresponding language plugins (so as to not affect your analyses), and thus your profiles will progressively diverge from the updated built-in profiles of each language plugin 

This is why you can use the "Restore Built-In Profile" action:

  • If you had removed the built-in profiles, they will be recreated
  • If you just modified them, they will be reset to their default set of rules

Deleting a Profile

Click on the Delete button at the top-right of the profile detail pane. Deleting a quality profile will remove its project associations. If nothing else is done, the default profile is used to perform the next analysis on the formerly-associated projects.

Note that you will not be able to delete a language's default profile. Nor will you be able to delete a profile that is the parent of another profile.

  • No labels