Skip to content

i. Understanding Sonar Data

Steven Senatori edited this page Mar 30, 2015 · 2 revisions

What is Sonar Data

When we analyze source code with a static analysis tool like sonar, we get some statistics which sonar provides on the dashboard.

![Sonar Dashboard](https://github.com/awltech/resources/raw/master/sonar-data-migrator/Sonar Dashboard.png)

As seen above, the dashboard gives you all static data, meaning you can generate the same statistics as long as your code is the same and regardless of which sonar server you generate this report from. This means if you maintain the same DB state and configuration (used during JUnit execution), same profile with same rules (used for analyzing sonar issues (violations)) and same code (for other statistics like LOC, classes etc.), you can easily obtain the same report on another sonar server. So theres nothing to do to in order to obtain this data if you just perform the analysis on another sonar server.

Then what is the data we need to migrate when we change sonar server?

Once you analyze a report with sonar, there is some data we manually add to this report. This includes

  1. Marking sonar issues as False positive
  2. Adding comment to issue
  3. Adding action plan
  4. Assign issue to any action plan
  5. Assign issue to any user
  6. Changing severity of issue manually (different than defined by rule)
  7. Changing Issue status (Confirmed, Resolved, Reopened)

Besides that there are users who are registered on sonar and associated with comments, issues etc. Migrating data also requires migration of these users. The Sonar data migrator tool takes care of all this data.

![Sonar Data](https://github.com/awltech/resources/raw/master/sonar-data-migrator/Sonar Data.png)

Clone this wiki locally