Unable to configure multiple custom Quality Profiles to our Project in SonarQube

q_profiles
sonarqube

(Gourav Dhingra) #1

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

Version - Community Edition, version 7.2.1(build 14109) - LGPL v3

  • what are you trying to achieve

Assigning custom multiple quality profiles to our project in sonarqube to analyze the source code.

Quality profile needs to be added as follows.

  1. AEM-Java-Development
  2. AEM-Javascript-Development
  3. Findbugs Security JSP
  4. AEM-Web-Development
  • what have you tried so far to achieve this

We have installed HTML(Web), Javascript and Findbug plugins into Sonarqube and then imported custom quality profiles(rules in xml format). Then we are trying to assign these custom quality profiles with our project. Clicking on any selected Quality profile and then clicking on “Change Project” option and selecting our project and then our project is showing as selected in the quality profile. Then we analyzing our source code using mvn sonar:sonar command and after building the project into sonarqube, we found that only one custom profile(AEM-Java-Development) is getting added into our project with one sonarway - build in quality profile. Other custom quality profiles(AEM-Javascript-Development, Findbugs Security JSP and AEM-Web-Development) are not added into our project.


(G Ann Campbell) #2

Hi,

Could you send a screenshot of your project’s Quality Profiles page? You’ll find it under the project-level Administration > Quality Profiles.

Also, are there any errors in your server-side logs?

Ann


(Gourav Dhingra) #3

ProjectQualityProfile


(G Ann Campbell) #4

Hi,

Thanks for also posting the snippet of your project homepage. From it, I take that only two languages were found in this particular project: Java, XML since only those two profiles are listed. You Quality Profiles page screenshot doesn’t go down as far as XML, but I’m going to guess that what’s there for XML is “Default: Sonar way” since that’s the profile that was used in the most recent analysis.

To be clear, you can set a specific profile-per-project for each language recognized in your SonarQube server, but only the analyzers / profiles for the languages actually present in your project will be used in an analysis. Your homepage screenshot doesn’t include the LoC per language display at the top of that right-hand column, but I’m guessing it only shows 2 languages for this project.

To sum up: from what I can tell, everything is working as expected.

Ann


(Gourav Dhingra) #5

Added all four languages(HTML, Java, Javascript and JSP) under project administration. Please refer attached first screenshot in my previous reply. Still only 2 profiles are displaying in the project.


(G Ann Campbell) #6

Hi,

Does your project contains lines of code in those languages?

Specifically, what shows up at the top-right of your project homepage?

As an example:

Selection_073

Ann