]> source.dussan.org Git - sonarqube.git/commitdiff
Do not suggest the Coverage option in Clouds page if the project has no coverage...
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 22 Jun 2011 17:13:04 +0000 (19:13 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 22 Jun 2011 17:13:04 +0000 (19:13 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb

index 006184a5a26074743ea5ac908d76e8a3dc3664eb..ab1a6973fa20df5659e50f8be2e029fc095fd4a0 100644 (file)
@@ -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={