Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to organize projects in SonarQube?

Tags:

sonarqube

I am looking into a way to organize projects in SonarQube, and find out I have to pay for such a thing:http://www.sonarqube.org/bring-a-new-dimension-to-sonar-with-the-views-plugin/. Compare to everything is free in Jenkins, this product starts to surprise me. Is there any other free plugin available for this purpose? Another thing is I am trying to get an evaluation license for PL/SQL (have to pay for this too), but got no reply after two days. Guess this product has no competitors.

like image 263
Jirong Hu Avatar asked Jan 13 '16 21:01

Jirong Hu


People also ask

How do I set sonar project properties?

SonarQube Properties and Parameters Global analysis parameters, defined in the UI, apply to all the projects (From the top bar, go to Settings > General Settings) Project analysis parameters, defined in the UI, override global parameters (At a project level, go to Configuration > Settings)

How do I add projects to portfolio in SonarQube?

To add projects to a Portfolio, navigate to the Portfolio you want to add a project to. Select Edit Definition from Portfolio Settings. Click the pencil icon next to Project selection mode, and select one of the following options: Manual – choose the projects individually.

What is the use of project key in SonarQube?

The project key can be updated (without losing the history on the project) at Project Settings > Update Key. The new key must contain at least one non-digit character. Allowed characters are: 'a' through 'z', 'A' through 'Z', '-' (dash), '_' (underscore), '.


2 Answers

SonarQube is free. You run project analysis (after getting / running unit tests, static code analysis, code coverage jacoco/cobertura, jmeter performance testing etc) or some analysis using sonar based analysis mechanism.

There are free and some commercial plugins available within SonarQube that you can download/install (trial/full license) and get what the commercial paid plugin offers.

One of those plugin is "Views portfolio plugin". It's easy to download / install (check SonarQube documentation on how to get/install plugins).

For organizing projects, you have to create new dashboards, views, measures and use those in widgets. See this first: http://docs.sonarqube.org/display/PLUG/Views+plugin and http://www.sonarqube.org/everythings-a-component/

Once Views portfolio plugin is installed, you have to do the following:

  1. Make sure you are using latest / newer version of SonarQube 5.1.x and sonar-runner 2.4+

  2. Install the latest / stable Views portfolio plugin.

  3. Create new Views, sub-views (inside a View).

  4. Create new Measures and Filters. See few post/links below.

  5. Run sonar analysis (for ex: run sonarRunner task in Gradle or sonar-runner standalone analysis in project's workspace) on some/all projects you have.

  6. Run "sonar-runner views" (create Jenkins job). This will populate all the Views / sub-views that you have created with the latest sonar data.

  7. At this point, create new Dashboards / default dashboard per team, per project type, per location etc and use the filters, views, measures in the widgets.

  8. Any time you'll run sonarqube analysis on a project, you have to assign that project in ONE of the View or its Sub-View and again make sure to run "sonar-runner views" (at command / $ prompt or via Jenkins Execute Shell build step).

NOTE: Views portfolio plugin doesn't treat ALL Sonar based projects's metrics as components but most of those project metrics can be treated/read by Views portfolio plugin as "components".

For ex: see here: SonarQube - Views Portfolio Plugin aka Helicopter View nemo - Combined all projects metrics

Other useful links: SonarQube - Views Portfolio Plugin - Project vs Filter Motion Chart and SonarQube - Views Portfolio Plugin aka Helicopter View nemo - Combined all projects metrics

like image 79
AKS Avatar answered Sep 30 '22 13:09

AKS


This is a paid feature of SonarQube, so look like all plugin recommended above are now removed.

like image 39
Tien Hoang Avatar answered Sep 30 '22 15:09

Tien Hoang