简体   繁体   中英

Project segregation in Sonar Qube

I have a projects structure like as shown below.

在此输入图像描述

Cloud projects folder are having four type projects ( eco-projects, evn-projects, met-projects, svn-projects )

Each type of projects contains again four different projects, like for example in eco-projects we have eco-1-projects, eco-2-projects, eco-3-projects,eco-4-projects .

I have integrated this in Sonar Qube which I got only one Project as Cloud projects like as shown below, when shows all the combined projects source code.

在此输入图像描述

Can we have a hierarchy like visualization in Sonar Qube, like for example lets say when I click the Cloud Projects in Sonar Dashbaord, It will navigate to another four project such as eco-projects, evn-projects, met-projects, svn-projects and now lets say when I click eco-projects it will show me eco-1-projects, eco-2-projects, eco-3-projects,eco-4-projects and now when I click eco-1-projects it will show its source code related dashboard and coverages

My sonar-project.properties is given below

# Required metadata
sonar.projectKey=cloud-projects
sonar.projectName=Cloud Projects
sonar.projectVersion=1.0
# Language
sonar.language=java

# Encoding of the source files
sonar.sourceEncoding=UTF-8

sonar.modules=eco-projects, evn-projects, met-projects, svn-projects

eco-projects.sonar.projectName=eco-projects
eco-projects.sonar.language=java
eco-projects.sonar.modules=eco-1-projects, eco-2-projects, eco-3-projects,eco-4-projects

eco-projects.eco-1-projects.sonar.projectName=eco-1-projects
eco-projects.eco-1-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-1-projects.sonar.language=java

eco-projects.eco-2-projects.sonar.projectName=eco-2-projects
eco-projects.eco-2-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-2-projects.sonar.language=java

eco-projects.eco-3-projects.sonar.projectName=eco-3-projects
eco-projects.eco-3-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-3-projects.sonar.language=java

eco-projects.eco-4-projects.sonar.projectName=eco-4-projects
eco-projects.eco-4-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-4-projects.sonar.language=java
:
:
:

Can anyone please tell me some solution for this

AFAIK Sonar doesn't support something like this. It only supports projects, modules and files. This means that you've added (at least?) 1 extra layer Sonar can't work with.

Perhaps you can skip the top 'cloud-projects' level and create a sonar.properties file for each project type? If we take eco-projects as an example, you need to create a sonar.properties file for that and define eco-1-projects, eco-2-projects, etc. as modules. This means that eco-projects is visible in the Sonar dashboard and if you click on it and go to 'code' you'll see all modules. Click on a module to see the files (assuming that is the file level in your case).

BTW you can also use Sonar Dashboards as an extra layer, for example by adding all eco-projects in 1 dashboard.

In SonarQube's menu you have : "Issues", "Measures", "Code" and "Dashboard".

"Code" is the one you want. There, you will find a breakdown by "component" (= one for each of your subprojects). Each line starts with a small icon (a box with an arrow going out of it, with a tooltip saying : "Open component's page"). This will restrict SQ's scope to this specific component.

Try it out here for example : https://sonarqube.com/code?id=org.apache.hbase%3Ahbase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM