Configuring Quality Profiles

Configuring Quality Profiles

Quality Profiles are central to SonarQube, since this is where the security related rules are defined and assigned to projects. For additional information on Quality Profiles, refer to Quality Profiles in the SonarQube Documentation. Quality profiles for Checkmarx are automatically created by the Checkmarx SonarQube plugin, therefore security rules are already predefined. For additional information about rules, please refer to Rules in the SonarQube Documentation.

Traditionally, when starting with quality profiles, you would use the default profile Sonar Way because it contains all the rules that are generally applicable to most projects. In some instances you could define a Quality Profile that uses Sonar Way and Checkmarx rules.

Defining a Quality Profile using SonarWay and Checkmarx Rules

To create a new quality profile, refer to Quality Profiles in the SonarQube Documentation for further information and instructions.

Notice

Creating a new quality profile is required from v6.5 of SonarQube because the default profile (Sonar way) is read-only and cannot be edited.

  • From the menu, select Quality Profiles. The Quality Profiles page appears with the list sorted according to their code languages as illustrated below.

    SQ_Quality_Profiles.png

  1. Click <Create>. The New Profile dialog appears.

  2. Specify the new profile as follows:

    Parameter

    Description

    Name

    Assign a name to the new profile

    Language

    Assign a name to the new profile

    Parent

  3. Once specified, click <Create> in the profile dialog. You are now able to configure the new quality profile.

    Configure_quality_profile.png

  1. Select the required quality profile from the list on the Quality Profiles page.

  2. Click <Change Parent>. The Change Parent dialog appears.

    Configure_quality_profile_-_Change_Parent_Sonar_Way.png

  3. Select Sonar Way (Built-in) and then click <Change>.

Assigning a Checkmarx Quality Profile to a Project

Checkmarx Quality profiles and their predefined rules can be assigned to projects as explained below.

To assign a quality profile to an existing language:

  1. Go to Projects and open the dsired project from the Project list.

  2. Go to Project Settings 6253283031.png and select Quality Profiles from the menu.

    Project_-_Project_Settings.png

  3. To assign a quality profile to a listed language, go to the row of the desired language and click <6252759745.png Change profile>. The Change Quality Profile dialog appears.

    Manage_Quality_Project_Profiles.png

  4. Select Always Use a Specific Quality Profile and select the desired quality profile from the list.

    Change_Quality_Profile.png

  5. Click <Cancel> as this change is automatically applied after the next analysis.

  1. Click <6252923619.png Add language>. The Add Language dialog appears.

    Add_Language.png

  2. Select the desired language. The Choose a Profile field becomes available.

  3. Select a quality profile from the list and then click <Save>. The new language is added with the quality profile assigned.

Notice

You need to assign a quality profile to the project for each language that your project supports.