From b7edfd1d01532f396fd37c9d5990b15a875a81f0 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Mon, 17 Oct 2011 15:23:58 +0200 Subject: [PATCH] SONAR-1928 Fix problem with metric order --- .../sonar/plugins/core/widgets/hotspot_metric.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspot_metric.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspot_metric.html.erb index 3d9ac5d1459..86cc3f88821 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspot_metric.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspot_metric.html.erb @@ -27,7 +27,7 @@ :conditions => [snapshots_conditions.join(' AND '), snapshots_values], :include => ['project', 'measures'], :order => "project_measures.value #{'DESC' if metric.direction<0}", - :limit => limit) + :limit => limit) end %> @@ -48,7 +48,11 @@ <% - metric_max_value = snapshots.first.measure(metric).value + if metric.direction > 0 + metric_max_value = snapshots.last.measure(metric).value + else + metric_max_value = snapshots.first.measure(metric).value + end snapshots.each do |s| measure = s.measure(metric) resource = s.resource -- 2.39.5