Start Free
Latest | Quality standards administration | Managing quality profiles | Creating a quality profile

Creating a custom quality profile

On this page

The Sonar way profile is designed to be broadly suitable for most projects, but it is intended only as a starting point. In most cases, you will want to adjust your profile as the project progresses.

If you have multiple projects, you might also need to have different profiles for each. You might run into the following situations:

  • You have different technical requirements from one project to another.
  • You want to ensure stronger requirements for some of your projects than for others.

To create a quality profile, you need the Administer Quality Profiles permission. You can:

  • Extend an existing quality profile (duplicate an existing profile with inheritance).
  • Copy an existing quality profile (duplicate an existing profile without inheritance).
  • Create a quality profile from scratch.
  • Import a quality profile from another SonarQube instance.

We highly recommend that you customize your profiles by extending the Sonar way profile. This allows you to manage most use cases. Indeed, if your profiles inherit from the Sonar way profile, you will automatically benefit from:

  • Newly implemented rules.
  • Changes in a rule’s configuration.
  • The deactivation of deprecated rules.

Extending a quality profile

When you extend a profile, you create a child profile that inherits all the activated rules in the parent profile. You can then activate additional rules in the child, beyond those that are inherited. You can also deactivate rules that are activated in the parent. 

For more information about inheritance, see Understanding quality profiles.

By using the Create button

  1. Go to the Quality Profiles page.
  2. In the top right corner of the page, select Create. The New Quality Profile page opens.
  3. Select Extend an existing quality profile.
  4. In Language, select the language of the new quality profile.
  5. In Parent, select the quality profile you want to extend.
  6. In Name, enter the name of the new quality profile.
  7. Select Create.

To change the created profile, see Editing a custom quality profile.

From the parent profile's menu

  1. Retrieve the quality profile you want to extend.
  2. Select the three-dot button and select Extend in the menu. The Extend Profile dialog opens.
  3. In New name, enter the name of the new quality profile.
  4. Select Extend.

To change the created profile, see Editing a custom quality profile.

Copying a quality profile

  1. Go to the Quality Profiles page.
  2. In the top right corner of the page, select Create. The New Quality Profile page opens.
  3. Select Copy an existing quality profile.
  4. In Language, select the language of the new quality profile.
  5. In Parent, select the quality profile you want to copy.
  6. In Name, enter the name of the new quality profile.
  7. Select Create.

To change the created profile, see Editing a custom quality profile.

Creating a quality profile from scratch

  1. Go to the Quality Profiles page.
  2. In the top right corner of the page, select Create. The New Quality Profile page opens.
  3. Select Create a blank quality profile.
  4. In Language, select the language of the new quality profile.
  5. In Name, enter the name of the new quality profile.
  6. Select Create.

To change the created profile, see Editing a custom quality profile.

Importing a quality profile from another SonarQube instance

You can export a custom quality profile to an XML file and import it from another SonarQube instance. SonarQube Server, Cloud, and SonarQube Community Build support this feature. 

When you import the quality profile:

  • If a quality profile with an identical name already exists, it will be updated. The update process involves adding any active rules from the backup that were not active in the existing profile. Existing active rules will not be updated.
  • Otherwise, a new profile is created.

Any user can export a quality profile.You need the Administer Quality Profiles permission to import a quality profile.

To export a custom quality profile:

  1. Go to Quality Profiles.
  2. Locate the quality profile's row and select the three-dot button in the far right of the row.
  3. Select Back up in the menu.

To import a backed up quality profile:

  1. Go to Quality Profiles.
  2. In the top right corner of the page, select Restore. The Restore File dialog opens.
  3. Select Choose File and select the XML file.
  4. Select Restore.

Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License