aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-06-22 19:13:04 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-06-22 19:13:04 +0200
commit8a2a5892cbbaf25bf04341cd3dc6c1b0257778b2 (patch)
treebeed6ee94fe5bac1037875ca36d79e5b1a6d4e9a /sonar-server
parentc0009d2cb3044f887e90402146e42472d3388828 (diff)
downloadsonarqube-8a2a5892cbbaf25bf04341cd3dc6c1b0257778b2.tar.gz
sonarqube-8a2a5892cbbaf25bf04341cd3dc6c1b0257778b2.zip
Do not suggest the Coverage option in Clouds page if the project has no coverage measure
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb
index 006184a5a26..ab1a6973fa2 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb
@@ -32,7 +32,11 @@ class CloudController < ApplicationController
@size_metric=Metric.by_key(params[:size]||'ncloc')
@color_metric=Metric.by_key(params[:color]||'coverage')
-
+
+ if @snapshot.measure(@color_metric).nil?
+ @color_metric=Metric.by_key('violations_density')
+ end
+
snapshot_conditions='snapshots.islast=:islast AND snapshots.scope=:scope AND snapshots.qualifier!=:test_qualifier AND
(snapshots.id=:sid OR (snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path))'
snapshot_values={