import org.sonar.api.Property;
import org.sonar.api.checks.NoSonarFilter;
import org.sonar.api.resources.Java;
-import org.sonar.plugins.core.batch.MavenInitializer;
import org.sonar.plugins.core.batch.ExcludedResourceFilter;
+import org.sonar.plugins.core.batch.MavenInitializer;
import org.sonar.plugins.core.charts.DistributionAreaChart;
import org.sonar.plugins.core.charts.DistributionBarChart;
import org.sonar.plugins.core.charts.XradarChart;
extensions.add(SizeWidget.class);
extensions.add(EventsWidget.class);
extensions.add(CustomMeasuresWidget.class);
- extensions.add(NewCoverageWidget.class);
// chart
extensions.add(XradarChart.class);
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.plugins.core.widgets;
-
-import org.sonar.api.web.AbstractRubyTemplate;
-import org.sonar.api.web.Description;
-import org.sonar.api.web.RubyRailsWidget;
-import org.sonar.api.web.WidgetCategory;
-
-@WidgetCategory({"Tests"})
-@Description("TODO")
-public class NewCoverageWidget extends AbstractRubyTemplate implements RubyRailsWidget {
- public String getId() {
- return "new_coverage";
- }
-
- public String getTitle() {
- return "New coverage";
- }
-
- @Override
- protected String getTemplatePath() {
- return "/org/sonar/plugins/core/widgets/new_coverage.html.erb";
- }
-}
\ No newline at end of file
</tr>
</table>
<% end %>
+
+
+<%
+if dashboard_configuration.selected_period?
+ new_lines_to_cover_measure=measure('new_lines_to_cover')
+ if new_lines_to_cover_measure
+ new_lines=new_lines_to_cover_measure.variation(dashboard_configuration.period_index)
+ if new_lines
+ new_coverage=measure('new_coverage')
+ new_line_coverage=measure('new_line_coverage')
+ new_branch_coverage=measure('new_branch_coverage')
+%>
+ <h3>on changed code (<%= new_lines.to_i -%> new lines to cover)</h3>
+ <p>
+ Coverage: <%= new_coverage.format_numeric_value(variation_value(new_coverage)) -%><br/>
+ Line coverage: <%= new_line_coverage.format_numeric_value(variation_value(new_line_coverage)) -%><br/>
+ Branch coverage: <%= new_branch_coverage.format_numeric_value(variation_value(new_branch_coverage)) -%>
+ </p>
+<%
+ end
+ end
+end
+%>
\ No newline at end of file
+++ /dev/null
-<h2>New coverage</h2>
- <table>
- <tr>
- <td>New lines</td>
- <% m=measure('new_lines_to_cover') %>
- <% 5.times do |index| %>
- <td>
- <%= format_variation(m, :index => index+1) -%>
- </td>
- <% end %>
- </tr>
- <tr>
- <td>New uncovered</td>
- <% m=measure('new_uncovered_lines') %>
- <% 5.times do |index| %>
- <td>
- <%= format_variation(m, :index => index+1) -%>
- </td>
- <% end %>
- </tr>
- <tr>
- <td>New conditions</td>
- <% m=measure('new_conditions_to_cover') %>
- <% 5.times do |index| %>
- <td>
- <%= format_variation(m, :index => index+1) -%>
- </td>
- <% end %>
- </tr>
- <tr>
- <td>New uncovered conditions</td>
- <% m=measure('new_uncovered_conditions') %>
- <% 5.times do |index| %>
- <td>
- <%= format_variation(m, :index => index+1) -%>
- </td>
- <% end %>
- </tr>
- </table>