DescriptionWidget.class,
ComplexityWidget.class,
RulesWidget.class,
- RulesWidget2.class,
+ IssuesBySeverity.class,
SizeWidget.class,
EventsWidget.class,
CustomMeasuresWidget.class,
+++ /dev/null
-/*
- * 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
--- /dev/null
+/*
+ * 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
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
--- /dev/null
+<%
+ 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') -%>
+ <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') -%>
+ <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> <%= 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> <%= 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> <%= 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> <%= 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> <%= 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>
+++ /dev/null
-<%
- 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') -%>
- <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') -%>
- <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> <%= 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> <%= 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> <%= 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> <%= 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> <%= 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>