]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-249 add variations to design widgets
authorsimonbrandhof <simon.brandhof@gmail.com>
Fri, 3 Dec 2010 11:30:55 +0000 (11:30 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Fri, 3 Dec 2010 11:30:55 +0000 (11:30 +0000)
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb

index 2f772d05ce79cf48b87112cc2375a7b294e55717..14db73663a6697f2a4d62d5e8517a2d429ffa866 100644 (file)
@@ -13,8 +13,14 @@ if lcom || rfc
       <td width="50%" valign="top">
         <div class="dashbox">
           <h3>LCOM4</h3>
-          <p><span class="big"><%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) %> <%= tendency_icon(lcom, false) %></span> /class</p>
-          <p><%= format_measure(suspect_lcom4_density, :suffix => ' files having LCOM4>1', :url => url_for_drilldown('lcom4')) %> <%= tendency_icon(suspect_lcom4_density) %></p>
+          <p>
+            <span class="big"><%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%></span> /class
+            <%= dashboard_configuration.variation? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%>
+          </p>
+          <p>
+            <%= format_measure(suspect_lcom4_density, :suffix => ' files having LCOM4>1', :url => url_for_drilldown('lcom4')) -%>
+            <%= dashboard_configuration.variation? ? format_variation(suspect_lcom4_density) : trend_icon(suspect_lcom4_density) -%>
+          </p>
         </div>
       </td>
       <% end %>
@@ -22,7 +28,10 @@ if lcom || rfc
       <td width="50%" valign="top">
         <div class="dashbox">
           <h3>RFC</h3>
-          <p><span class="big"><%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) %> <%= tendency_icon(rfc, false) %></span> /class</p>
+          <p><span class="big">
+            <%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) -%></span> /class
+            <%= dashboard_configuration.variation? ? format_variation(rfc) : trend_icon(rfc, :big => true) -%>
+          </p>
         </div>
       </td>
       <% end %>
index e91e9857a9f06678503800641bd89aefea7f4e7c..22e5b28f956b1acb517bbbf06cc6690821ec05a0 100644 (file)
       <td valign="top" width="50%">
         <div class="dashbox">
           <p class="title">File tangle index</p>
-          <p><span class="big"><%= format_measure(file_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('file_tangle_index')) %> <%= tendency_icon(file_tangle_index, false) %></span></p>
+          <p>
+            <span class="big"><%= format_measure(file_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('file_tangle_index')) -%></span>
+            <%= dashboard_configuration.variation? ? format_variation(file_tangle_index) : trend_icon(file_tangle_index, :big => true) -%>
+          </p>
           <% if file_cycles %>
-          <p>> <%= format_measure(file_cycles, :suffix => ' cycles', :url => url_for_drilldown('file_cycles')) %></p>
+          <p>
+            > <%= format_measure(file_cycles, :suffix => ' cycles', :url => url_for_drilldown('file_cycles')) -%>
+            <%= dashboard_configuration.variation? ? format_variation(file_cycles) : trend_icon(file_cycles) -%>
+          </p>
           <% end %>
         </div>
       </td>
         <% if file_feedback_edges %>
         <div class="dashbox">
           <p class="title">Suspect file dependencies</p>
-          <p><span class="big"><%= format_measure(file_feedback_edges, :url => url_for_drilldown('file_feedback_edges')) %> <%= tendency_icon(file_feedback_edges) %></span></p>
+          <p>
+            <span class="big"><%= format_measure(file_feedback_edges, :url => url_for_drilldown('file_feedback_edges')) -%></span>
+            <%= dashboard_configuration.variation? ? format_variation(file_feedback_edges) : trend_icon(file_feedback_edges, :big => true) -%>
+          </p>
         </div>
         <% end %>
       </td>
index 3904ba97befb5fbe75a57618b2f3b45b4a02c463..ed783ddc40f003ea909304975944153b4c242b8b 100644 (file)
       <td valign="top" width="50%">
         <div class="dashbox">
           <p class="title">Package tangle index</p>
-          <p><span class="big"><%= format_measure(package_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('package_tangle_index')) %> <%= tendency_icon(package_tangle_index, false) %></span></p>
+          <p>
+            <span class="big"><%= format_measure(package_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('package_tangle_index')) -%></span>
+            <%= dashboard_configuration.variation? ? format_variation(package_tangle_index) : trend_icon(package_tangle_index, :big => true) -%>
+          </p>
           <% if package_cycles %>
-          <p>> <%= format_measure(package_cycles, :suffix => ' cycles', :url => url_for_drilldown('package_cycles')) %></p>
+          <p>
+            > <%= format_measure(package_cycles, :suffix => ' cycles', :url => url_for_drilldown('package_cycles')) -%>
+            <%= dashboard_configuration.variation? ? format_variation(package_cycles) : trend_icon(package_cycles) -%>
+          </p>
           <% end %>
         </div>
       </td>
         <% if package_feedback_edges || package_tangles %>
         <div class="dashbox">
           <p class="title">Dependencies to cut</p>
-          <p><%= format_measure(package_feedback_edges, :suffix => ' between packages', :url => url_for_drilldown('package_feedback_edges')) %> <%= tendency_icon(package_feedback_edges) %></p>
-          <p><%= format_measure(package_tangles, :suffix => ' between files', :url => url_for_drilldown('package_tangles')) %> <%= tendency_icon(package_tangles) %></p>
+          <p>
+            <%= format_measure(package_feedback_edges, :suffix => ' between packages', :url => url_for_drilldown('package_feedback_edges')) -%>
+            <%= dashboard_configuration.variation? ? format_variation(package_feedback_edges) : trend_icon(package_feedback_edges) -%>
+          </p>
+          <p>
+            <%= format_measure(package_tangles, :suffix => ' between files', :url => url_for_drilldown('package_tangles')) -%>
+            <%= dashboard_configuration.variation? ? format_variation(package_tangles) : trend_icon(package_tangles) -%>
+          </p>
         </div>
         <% end %>
       </td>