0

Is it possible to display the metrics value on the sonarqube dashboard directly through html.erb file? One of my metric is Rank

Can I just write <%= format_measure('Rank') %> to display on the dashboard? This donot print anything on dashboard.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76

1 Answers1

0

The format_measure is indeed the correct helper to print out the value of a metric in a widget.

There can be several reasons why you don't see the measure for that metric:

  • you haven't run any analysis on the project, in which case your plugin haven't pushed the measure for that metric yet
  • your plugin does not push correctly measure for that metric
    • Ex.: it pushes measures at file level but not at project level

In any case, you can take a look at our sample plugin to learn more, and more specifically at the widget template.

  • Thank you. Can you tell me how can I make histogram using my own metrics ? Or how can I access each element of rank .. rank is an array – adil irfan Jun 01 '16 at 05:06