aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-design-plugin/src
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-12-03 11:30:55 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-12-03 11:30:55 +0000
commit7220ec643ea48996bcdec31b4328dee06213e655 (patch)
treeffebe3f447ed923cfdc580c857e4c23f23c26e05 /plugins/sonar-design-plugin/src
parent1f93d163ae528fc491ad42d1c7be7b2db289a9cb (diff)
downloadsonarqube-7220ec643ea48996bcdec31b4328dee06213e655.tar.gz
sonarqube-7220ec643ea48996bcdec31b4328dee06213e655.zip
SONAR-249 add variations to design widgets
Diffstat (limited to 'plugins/sonar-design-plugin/src')
-rw-r--r--plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb15
-rw-r--r--plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb15
-rw-r--r--plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb20
3 files changed, 40 insertions, 10 deletions
diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb
index 2f772d05ce7..14db73663a6 100644
--- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb
+++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb
@@ -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 %>
diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb
index e91e9857a9f..22e5b28f956 100644
--- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb
+++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb
@@ -10,9 +10,15 @@
<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>
@@ -20,7 +26,10 @@
<% 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>
diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb
index 3904ba97bef..ed783ddc40f 100644
--- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb
+++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb
@@ -14,9 +14,15 @@
<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>
@@ -24,8 +30,14 @@
<% 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>