diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-06-13 19:20:55 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-06-13 19:21:59 +0200 |
commit | 951325a821d32fc2396461231b467d560b632fb6 (patch) | |
tree | d3b43b0649f3ae4f4ebb39d3f5d5321bb2240aa8 | |
parent | 457e860fff1600e98bbd04ed59b0e4e90742a63f (diff) | |
download | sonarqube-951325a821d32fc2396461231b467d560b632fb6.tar.gz sonarqube-951325a821d32fc2396461231b467d560b632fb6.zip |
SONAR-4395 The SQL request used to get hotspot on metric can be improved
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}.%" |