Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube: How to apply multiple quality profiles to one project?

I would like to use SonarQube 6.3.1 to analyze the Java and Kotlin code of an Android project. Therefore, I installed the Android Lint plugin besides the preinstalled SonarJava aka. Sonar way plugin. Both show up in the Java language dropdown in the Administration section of the project as shown in the screenshot.

Project / Administration

  • How can I apply multiple profiles at the same time?
  • Where can I find other profiles suitable for Java/Kotlin/Android projects?

Related posts

  • Sonarqube: use multiple custom quality profiles for a single multilanguage project...?
like image 982
JJD Avatar asked Jun 13 '17 12:06

JJD


People also ask

Is it possible to copy a profile from one SonarQube instance to another?

Copy a profile from one SonarQube instance to another? Use the Back up feature on the source instance to export the profile to an XML file. Use the Restore Profile feature on the target instance to import the file.

Can you make customers quality profile and quality gate in SonarQube?

All users can view every aspect of a quality gate. To make changes (create, edit or delete) users must be granted the Administer Quality Profiles and Gates permission. A project administrator can choose which quality gates their project is associated with. See Project Settings for more.

What is the default profile used in SonarQube quality profiles?

Built-in and default profiles SonarQube comes with a built-in quality profile defined for each supported language, called the Sonar way profile (it is marked with the BUILT-IN tag in the interface).

How do I create a new profile in SonarQube?

Creating Custom Quality Profile in SonarQube Let's click Quality Profiles tab, go to the Java section, copy Sonar way profile and rename this Custom Quality Profile. You can either assign this profile to an existing project or even declare it as default for all projects.


1 Answers

You apply both profiles by creating a third profile that contains all the rules in each of your source profiles.

The easiest way to accomplish that is to

  1. Go to Quality Profiles and create a new profile
  2. Now in the list of profiles, click on the rule count for one of your source profiles. This takes you to the list of rules active in that profile
  3. Use the Bulk Change > Activate In... option to turn those rules on in your new profile
  4. Return to step 2 with the next source profile in your list.
like image 137
G. Ann - SonarSource Team Avatar answered Oct 01 '22 20:10

G. Ann - SonarSource Team