aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-06-13 19:20:55 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-06-13 19:21:59 +0200
commit951325a821d32fc2396461231b467d560b632fb6 (patch)
treed3b43b0649f3ae4f4ebb39d3f5d5321bb2240aa8
parent457e860fff1600e98bbd04ed59b0e4e90742a63f (diff)
downloadsonarqube-951325a821d32fc2396461231b467d560b632fb6.tar.gz
sonarqube-951325a821d32fc2396461231b467d560b632fb6.zip
SONAR-4395 The SQL request used to get hotspot on metric can be improved
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb3
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb3
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}.%"