]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4341 Provide an "Issues by Severity" widget which will replace the "Rules Compl...
authorJulien Lancelot <julien.lancelot@gmail.com>
Thu, 23 May 2013 15:25:56 +0000 (17:25 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Thu, 23 May 2013 15:25:56 +0000 (17:25 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget2.java [deleted file]
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/IssuesBySeverity.java [new file with mode: 0644]
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/issues_by_severity.html.erb [new file with mode: 0644]
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules2.html.erb [deleted file]

index 826b347868939d2daac3848fe978c97ca261bbbf..5849d7c5f0682f43d4662d31ca65f571058b43b4 100644 (file)
@@ -365,7 +365,7 @@ public final class CorePlugin extends SonarPlugin {
       DescriptionWidget.class,
       ComplexityWidget.class,
       RulesWidget.class,
-      RulesWidget2.class,
+      IssuesBySeverity.class,
       SizeWidget.class,
       EventsWidget.class,
       CustomMeasuresWidget.class,
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget2.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget2.java
deleted file mode 100644 (file)
index 559204c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.plugins.core.widgets;
-
-import org.sonar.api.web.WidgetCategory;
-
-@WidgetCategory({"Rules"})
-public class RulesWidget2 extends CoreWidget {
-
-  public RulesWidget2() {
-    super("rules2", "Rules Compliance 2", "/org/sonar/plugins/core/widgets/rules2.html.erb");
-  }
-}
\ No newline at end of file
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/IssuesBySeverity.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/IssuesBySeverity.java
new file mode 100644 (file)
index 0000000..9c532d1
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2013 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.plugins.core.widgets.issues;
+
+import org.sonar.api.web.WidgetCategory;
+import org.sonar.plugins.core.widgets.CoreWidget;
+
+@WidgetCategory({"Issues"})
+public class IssuesBySeverity extends CoreWidget {
+
+  public IssuesBySeverity() {
+//    super("issues_by_severity", "Issues by Severity", "/org/sonar/plugins/core/widgets/issues/issues_by_severity.html.erb");
+    super("issues_by_severity", "Issues by Severity",
+      "/Users/julienlancelot/Dev/Sources/sonar/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/issues_by_severity.html.erb");
+  }
+}
\ No newline at end of file
index 24bf89edfc5397fd4fc26002d108cb4d728c631b..70b66438fead77d102da01e982eb13a7864ab24e 100644 (file)
@@ -1078,8 +1078,13 @@ widget.unresolved_issues_per_assignee.not_assigned=Not assigned
 
 widget.unresolved_issues_statuses.name=Unresolved issue statuses
 widget.unresolved_issues_statuses.description=Display the number of unresolved issues according to their status : Open, Reopen and Accepted.
-widget.unresolved_issues_statuses.added=Added:
-widget.unresolved_issues_statuses.removed=Removed:
+
+widget.issues_by_severity.name=Issues by Severity
+widget.issues_by_severity.description=Reports issues by severity.
+widget.issues_by_severity.issues=Issues
+widget.issues_by_severity.false_positives=False positives
+widget.issues_by_severity.added=Added:
+widget.issues_by_severity.removed=Removed:
 
 widget.action_plans.name=Action plans
 widget.action_plans.description=Shows all the open action plans of the project
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/issues_by_severity.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/issues_by_severity.html.erb
new file mode 100644 (file)
index 0000000..9f70cd0
--- /dev/null
@@ -0,0 +1,168 @@
+<%
+  issues = @snapshot.measure('issues') # TODO replace by violations
+  false_positive_issues = @snapshot.measure('false_positive_issues') # TODO replace by false_positive_reviews
+  blocker_issues = @snapshot.measure('blocker_issues') # TODO replace by violations...
+  critical_issues = @snapshot.measure('critical_issues')
+  major_issues = @snapshot.measure('major_issues')
+  minor_issues = @snapshot.measure('minor_issues')
+  info_issues = @snapshot.measure('info_issues')
+  new_issues = @snapshot.measure('new_issues')
+%>
+<table width="100%">
+  <tr>
+    <td valign="top">
+      <div class="dashbox">
+        <h3><%= message('widget.issues_by_severity.issues') -%></h3>
+        <div class="marginbottom10">
+            <span class="big">
+              <%= format_measure(issues, :url => url_for(:controller => 'drilldown', :action => 'issues', :id => @project.key)) -%>
+            </span>
+            <%= dashboard_configuration.selected_period? ? format_variation(issues) : trend_icon(issues) -%>
+            <%
+               if @dashboard_configuration.selected_period?
+                 issues_variation = variation_value(issues)
+                 new_issues_variation = variation_value(new_issues)
+                 estimated_cleared_issues = (new_issues_variation - issues_variation).to_i if issues_variation && new_issues_variation
+            %>
+              <% if new_issues_variation && new_issues_variation > 0 %>
+                <br/>
+                <span style="font-weight: bold">
+                  <%= message('widget.issues_by_severity.added') -%>&nbsp;
+                  <a href="<%= url_for(:controller => 'drilldown', :action => 'issues', :id => @project.key, :period => dashboard_configuration.period_index) -%>" class="varw">
+                    <%= format_variation(new_issues, :style => 'none', :default => '-') -%></a>
+                </span>
+              <% end %>
+              <% if estimated_cleared_issues && estimated_cleared_issues > 0 %>
+                <br/>
+                <span style="font-weight: bold">
+                  <%= message('widget.issues_by_severity.removed') -%>&nbsp;
+                  <span class="varb"><%= estimated_cleared_issues -%></span>
+                </span>
+              <% end %>
+            <% end %>
+        </div>
+        <h3><%= message('widget.issues_by_severity.false_positives') -%></h3>
+        <div>
+          <span class="big">
+            <%= format_measure(false_positive_issues, :url => url_for(:controller => 'drilldown', :action => 'issues', :id => @project.key)) -%>
+          </span>
+          <%= dashboard_configuration.selected_period? ? format_variation(false_positive_issues) : trend_icon(false_positive_issues) -%>
+        </div>
+      </div>
+    </td>
+
+               <td valign="top" nowrap>
+                       <%
+        values = [blocker_issues, critical_issues, major_issues, minor_issues, info_issues]
+        if dashboard_configuration.selected_period?
+          values = values.map{|m| m ? (m.variation(dashboard_configuration.period_index)||0) : 0}
+        else
+          values = values.map{|m| m ? (m.value||0) : 0}
+        end
+        max = values.map{|val| val.abs}.max
+                       %>
+                           <table class="clear width100">
+                             <tr>
+                               <td><%= image_tag 'priority/BLOCKER.png'%></td>
+                               <td> &nbsp;<%= link_to message('blocker'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'BLOCKER'} %></td>
+                               <td style="padding: 0 5px;" align="right">
+                                 <%= format_measure(blocker_issues) -%>
+                               </td>
+                               <td>
+                                 <%= dashboard_configuration.selected_period? ? format_variation(blocker_issues) : trend_icon(blocker_issues, :empty => true) -%>
+                               </td>
+                               <td align="left" style="padding-bottom:2px; padding-top:2px;">
+                                 <% if max > 0 %>
+                                 <% if dashboard_configuration.selected_period? %>
+                                   <%= barchart(:width => 35, :percent => (values[0]<0 ? (100 * values[0] / max).to_i : 0), :color => '#078C00') %>
+                                   <%= barchart(:width => 35, :percent => (values[0]>0 ? (100 * values[0] / max).to_i : 0), :color => '#cc0000') %>
+                                 <% else %>
+                                   <%= barchart(:width => 70, :percent => (100 * values[0] / max).to_i) %>
+                                 <% end %>
+                                 <% end %>
+                               </td>
+                             </tr>
+                             <tr>
+                               <td><%= image_tag 'priority/CRITICAL.png'  %></td>
+                               <td> &nbsp;<%= link_to message('critical'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'CRITICAL'} %></td>
+                               <td style="padding: 0 5px;" align="right">
+                                 <%= format_measure(critical_issues) -%>
+                               </td>
+                               <td>
+                                 <%= dashboard_configuration.selected_period? ? format_variation(critical_issues) : trend_icon(critical_issues, :empty => true) -%>
+                               </td>
+                               <td align="left" style="padding-bottom:2px; padding-top:2px;">
+                                 <% if max > 0 %>
+                                 <% if dashboard_configuration.selected_period? %>
+                                   <%= barchart(:width => 35, :percent => (values[1]<0 ? (100 * values[1] / max).to_i : 0), :color => '#078C00') %>
+                                   <%= barchart(:width => 35, :percent => (values[1]>0 ? (100 * values[1] / max).to_i : 0), :color => '#cc0000') %>
+                                 <% else %>
+                                   <%= barchart(:width => 70, :percent => (100 * values[1] / max).to_i) %>
+                                 <% end %>
+                                 <% end %>
+                               </td>
+                             </tr>
+                             <tr>
+                             <td><%= image_tag 'priority/MAJOR.png'  %></td>
+                               <td> &nbsp;<%= link_to message('major'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'MAJOR'} %></td>
+                               <td style="padding: 0 5px;" align="right">
+                                 <%= format_measure(major_issues) -%>
+                               </td>
+                               <td>
+                                 <%= dashboard_configuration.selected_period? ? format_variation(major_issues) : trend_icon(major_issues, :empty => true) -%>
+                               </td>
+                              <td align="left" style="padding-bottom:2px; padding-top:2px;">
+                                <% if max > 0 %>
+                                 <% if dashboard_configuration.selected_period? %>
+                                   <%= barchart(:width => 35, :percent => (values[2]<0 ? (100 * values[2] / max).to_i : 0), :color => '#078C00') %>
+                                   <%= barchart(:width => 35, :percent => (values[2]>0 ? (100 * values[2] / max).to_i : 0), :color => '#cc0000') %>
+                                 <% else %>
+                                   <%= barchart(:width => 70, :percent => (100 * values[2] / max).to_i) %>
+                                 <% end %>
+                                 <% end %>
+                               </td>
+                             </tr>
+                             <tr>
+                             <td><%= image_tag 'priority/MINOR.png'  %></td>
+                               <td> &nbsp;<%= link_to message('minor'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'MINOR'} %></td>
+                               <td style="padding: 0 5px;" align="right">
+                                 <%= format_measure(minor_issues) -%>
+                               </td>
+                               <td>
+                                 <%= dashboard_configuration.selected_period? ? format_variation(minor_issues) : trend_icon(minor_issues, :empty => true) -%>
+                               </td>
+                              <td align="left" style="padding-bottom:2px; padding-top:2px;">
+                                 <% if max > 0 %>
+                                 <% if dashboard_configuration.selected_period? %>
+                                   <%= barchart(:width => 35, :percent => (values[3]<0 ? (100 * values[3] / max).to_i : 0), :color => '#078C00') %>
+                                   <%= barchart(:width => 35, :percent => (values[3]>0 ? (100 * values[3] / max).to_i : 0), :color => '#cc0000') %>
+                                 <% else %>
+                                   <%= barchart(:width => 70, :percent => (100 * values[3] / max).to_i) %>
+                                 <% end %>
+                                 <% end %>
+                               </td>
+                             </tr>
+                             <tr>
+                             <td><%= image_tag 'priority/INFO.png'  %></td>
+                               <td> &nbsp;<%= link_to message('info'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'INFO'} %></td>
+                               <td style="padding: 0 5px;" align="right">
+                                 <%= format_measure(info_issues) -%>
+                               </td>
+                               <td>
+                                 <%= dashboard_configuration.selected_period? ? format_variation(info_issues) : trend_icon(info_issues, :empty => true) -%>
+                               </td>
+                              <td align="left" style="padding-bottom:2px; padding-top:2px;">
+                                <% if max > 0 %>
+                                 <% if dashboard_configuration.selected_period? %>
+                                   <%= barchart(:width => 35, :percent => (values[4]<0 ? (100 * values[4] / max).to_i : 0), :color => '#078C00') %>
+                                   <%= barchart(:width => 35, :percent => (values[4]>0 ? (100 * values[4] / max).to_i : 0), :color => '#cc0000') %>
+                                 <% else %>
+                                   <%= barchart(:width => 70, :percent => (100 * values[4] / max).to_i) %>
+                                 <% end %>
+                                 <% end %>
+                               </td>
+                             </tr>
+                           </table>
+           </td>
+         </tr>
+  </table>
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules2.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules2.html.erb
deleted file mode 100644 (file)
index c0e2434..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-<%
-  issues = @snapshot.measure('issues')
-  density = @snapshot.measure('issues_density')
-  blocker_issues = @snapshot.measure('blocker_issues')
-  critical_issues = @snapshot.measure('critical_issues')
-  major_issues = @snapshot.measure('major_issues')
-  minor_issues = @snapshot.measure('minor_issues')
-  info_issues = @snapshot.measure('info_issues')
-  new_issues = @snapshot.measure('new_issues')
-%>
-<table width="100%">
-  <tr>
-    <td valign="top">
-      <div class="dashbox">
-        <h3><%= message('widget.rules.issues') -%></h3>
-        <div class="marginbottom10">
-            <span class="big">
-              <%= format_measure(issues, :url => url_for(:controller => 'drilldown', :action => 'issues', :id => @project.key)) -%>
-            </span>
-            <%= dashboard_configuration.selected_period? ? format_variation(issues) : trend_icon(issues) -%>
-            <%
-               if @dashboard_configuration.selected_period?
-                 issues_variation = variation_value(issues)
-                 new_issues_variation = variation_value(new_issues)
-                 estimated_cleared_issues = (new_issues_variation - issues_variation).to_i if issues_variation && new_issues_variation
-            %>
-              <% if new_issues_variation && new_issues_variation > 0 %>
-                <br/>
-                <span style="font-weight: bold">
-                  <%= message('widget.rules.added') -%>&nbsp;
-                  <a href="<%= url_for(:controller => 'drilldown', :action => 'issues', :id => @project.key, :period => dashboard_configuration.period_index) -%>" class="varw"><%= format_variation(new_issues, :style => 'none', :default => '-') -%></a>
-                </span>
-              <% end %>
-              <% if estimated_cleared_issues && estimated_cleared_issues > 0 %>
-                <br/>
-                <span style="font-weight: bold">
-                  <%= message('widget.rules.removed') -%>&nbsp;
-                  <span class="varb"><%= estimated_cleared_issues -%></span>
-                </span>
-              <% end %>
-            <% end %>
-        </div>
-        <% if density %>
-        <h3><%= message('widget.rules.rules_compliance') -%></h3>
-        <div>
-          <span class="big">
-            <%= format_measure(density, :url => url_for_drilldown('weighted_issues', {:highlight => 'weighted_issues'})) -%>
-          </span>
-          <%= dashboard_configuration.selected_period? ? format_variation(density) : trend_icon(density) -%>
-        </div>
-        <% end %>
-      </div>
-    </td>
-
-               <td valign="top" nowrap>
-                       <%
-        values = [blocker_issues, critical_issues, major_issues, minor_issues, info_issues]
-        if dashboard_configuration.selected_period?
-          values = values.map{|m| m ? (m.variation(dashboard_configuration.period_index)||0) : 0}
-        else
-          values = values.map{|m| m ? (m.value||0) : 0}
-        end
-        max = values.map{|val| val.abs}.max
-                       %>
-                           <table class="clear width100">
-                             <tr>
-                               <td><%= image_tag 'priority/BLOCKER.png'%></td>
-                               <td> &nbsp;<%= link_to message('blocker'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'BLOCKER'} %></td>
-                               <td style="padding: 0 5px;" align="right">
-                                 <%= format_measure(blocker_issues) -%>
-                               </td>
-                               <td>
-                                 <%= dashboard_configuration.selected_period? ? format_variation(blocker_issues) : trend_icon(blocker_issues, :empty => true) -%>
-                               </td>
-                               <td align="left" style="padding-bottom:2px; padding-top:2px;">
-                                 <% if max > 0 %>
-                                 <% if dashboard_configuration.selected_period? %>
-                                   <%= barchart(:width => 35, :percent => (values[0]<0 ? (100 * values[0] / max).to_i : 0), :color => '#078C00') %>
-                                   <%= barchart(:width => 35, :percent => (values[0]>0 ? (100 * values[0] / max).to_i : 0), :color => '#cc0000') %>
-                                 <% else %>
-                                   <%= barchart(:width => 70, :percent => (100 * values[0] / max).to_i) %>
-                                 <% end %>
-                                 <% end %>
-                               </td>
-                             </tr>
-                             <tr>
-                               <td><%= image_tag 'priority/CRITICAL.png'  %></td>
-                               <td> &nbsp;<%= link_to message('critical'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'CRITICAL'} %></td>
-                               <td style="padding: 0 5px;" align="right">
-                                 <%= format_measure(critical_issues) -%>
-                               </td>
-                               <td>
-                                 <%= dashboard_configuration.selected_period? ? format_variation(critical_issues) : trend_icon(critical_issues, :empty => true) -%>
-                               </td>
-                               <td align="left" style="padding-bottom:2px; padding-top:2px;">
-                                 <% if max > 0 %>
-                                 <% if dashboard_configuration.selected_period? %>
-                                   <%= barchart(:width => 35, :percent => (values[1]<0 ? (100 * values[1] / max).to_i : 0), :color => '#078C00') %>
-                                   <%= barchart(:width => 35, :percent => (values[1]>0 ? (100 * values[1] / max).to_i : 0), :color => '#cc0000') %>
-                                 <% else %>
-                                   <%= barchart(:width => 70, :percent => (100 * values[1] / max).to_i) %>
-                                 <% end %>
-                                 <% end %>
-                               </td>
-                             </tr>
-                             <tr>
-                             <td><%= image_tag 'priority/MAJOR.png'  %></td>
-                               <td> &nbsp;<%= link_to message('major'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'MAJOR'} %></td>
-                               <td style="padding: 0 5px;" align="right">
-                                 <%= format_measure(major_issues) -%>
-                               </td>
-                               <td>
-                                 <%= dashboard_configuration.selected_period? ? format_variation(major_issues) : trend_icon(major_issues, :empty => true) -%>
-                               </td>
-                              <td align="left" style="padding-bottom:2px; padding-top:2px;">
-                                <% if max > 0 %>
-                                 <% if dashboard_configuration.selected_period? %>
-                                   <%= barchart(:width => 35, :percent => (values[2]<0 ? (100 * values[2] / max).to_i : 0), :color => '#078C00') %>
-                                   <%= barchart(:width => 35, :percent => (values[2]>0 ? (100 * values[2] / max).to_i : 0), :color => '#cc0000') %>
-                                 <% else %>
-                                   <%= barchart(:width => 70, :percent => (100 * values[2] / max).to_i) %>
-                                 <% end %>
-                                 <% end %>
-                               </td>
-                             </tr>
-                             <tr>
-                             <td><%= image_tag 'priority/MINOR.png'  %></td>
-                               <td> &nbsp;<%= link_to message('minor'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'MINOR'} %></td>
-                               <td style="padding: 0 5px;" align="right">
-                                 <%= format_measure(minor_issues) -%>
-                               </td>
-                               <td>
-                                 <%= dashboard_configuration.selected_period? ? format_variation(minor_issues) : trend_icon(minor_issues, :empty => true) -%>
-                               </td>
-                              <td align="left" style="padding-bottom:2px; padding-top:2px;">
-                                 <% if max > 0 %>
-                                 <% if dashboard_configuration.selected_period? %>
-                                   <%= barchart(:width => 35, :percent => (values[3]<0 ? (100 * values[3] / max).to_i : 0), :color => '#078C00') %>
-                                   <%= barchart(:width => 35, :percent => (values[3]>0 ? (100 * values[3] / max).to_i : 0), :color => '#cc0000') %>
-                                 <% else %>
-                                   <%= barchart(:width => 70, :percent => (100 * values[3] / max).to_i) %>
-                                 <% end %>
-                                 <% end %>
-                               </td>
-                             </tr>
-                             <tr>
-                             <td><%= image_tag 'priority/INFO.png'  %></td>
-                               <td> &nbsp;<%= link_to message('info'), {:controller => 'drilldown', :action => 'issues', :id => @project.key, :severity => 'INFO'} %></td>
-                               <td style="padding: 0 5px;" align="right">
-                                 <%= format_measure(info_issues) -%>
-                               </td>
-                               <td>
-                                 <%= dashboard_configuration.selected_period? ? format_variation(info_issues) : trend_icon(info_issues, :empty => true) -%>
-                               </td>
-                              <td align="left" style="padding-bottom:2px; padding-top:2px;">
-                                <% if max > 0 %>
-                                 <% if dashboard_configuration.selected_period? %>
-                                   <%= barchart(:width => 35, :percent => (values[4]<0 ? (100 * values[4] / max).to_i : 0), :color => '#078C00') %>
-                                   <%= barchart(:width => 35, :percent => (values[4]>0 ? (100 * values[4] / max).to_i : 0), :color => '#cc0000') %>
-                                 <% else %>
-                                   <%= barchart(:width => 70, :percent => (100 * values[4] / max).to_i) %>
-                                 <% end %>
-                                 <% end %>
-                               </td>
-                             </tr>
-                           </table>
-           </td>
-         </tr>
-  </table>