From 951325a821d32fc2396461231b467d560b632fb6 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 13 Jun 2013 19:20:55 +0200 Subject: [PATCH] SONAR-4395 The SQL request used to get hotspot on metric can be improved --- .../plugins/core/widgets/hotspots/hotspot_metric.html.erb | 3 +-- .../widgets/hotspots/hotspot_most_violated_resources.html.erb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb index 09a42b4d6bd..103b9ac8bad 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb @@ -11,8 +11,7 @@ if metric.numeric? && !@snapshot.leaves_qualifiers.empty? snapshots_conditions=["snapshots.qualifier in (:qualifiers)", "snapshots.islast=:islast", "snapshots.status = 'P'"] snapshots_values={:qualifiers => @snapshot.leaves_qualifiers, :islast => true} - snapshots_conditions << '(snapshots.id=:sid OR (snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path))' - snapshots_values[:sid]=@snapshot.id + snapshots_conditions << '(snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path)' snapshots_values[:root_sid] = (@snapshot.root_snapshot_id || @snapshot.id) snapshots_values[:path]="#{@snapshot.path}#{@snapshot.id}.%" diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb index a26c9e73eca..af7aaf65adf 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb @@ -4,8 +4,7 @@ snapshots_conditions=["snapshots.qualifier in (:qualifiers)", "snapshots.islast=:islast", "snapshots.status = 'P'"] snapshots_values={:qualifiers => @snapshot.leaves_qualifiers, :islast => true} - snapshots_conditions << '(snapshots.id=:sid OR (snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path))' - snapshots_values[:sid]=@snapshot.id + snapshots_conditions << '(snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path)' snapshots_values[:root_sid] = (@snapshot.root_snapshot_id || @snapshot.id) snapshots_values[:path]="#{@snapshot.path}#{@snapshot.id}.%" -- 2.39.5