MeasureFilterTreemapWidget.class,
WelcomeWidget.class,
DocumentationCommentsWidget.class,
+ DuplicationsWidget.class,
// dashboards
ProjectDefaultDashboard.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;
+
+/**
+ * @author Patroklos PAPAPETROU
+ */
+
+public class DuplicationsWidget extends CoreWidget {
+
+ public DuplicationsWidget() {
+ super("duplications", "Duplications", "/org/sonar/plugins/core/widgets/duplications_widget.html.erb");
+ }
+
+}
widget.documentation_comments.undocu_api.suffix=\ undocu. API
widget.documentation_comments.public_api.suffix=\ Public API
+widget.duplications.name=Duplications
+widget.duplications.description= Reports on copy/paste and code duplications
+widget.duplications.duplications=Duplications
+widget.duplications.useless-duplications-title=Duplicated lines that can be reduced
+widget.duplications.lines.suffix=\ lines
+widget.duplications.blocks.suffix=\ blocks
+widget.duplications.files.suffix=\ files
+
widget.complexity.name=Complexity
widget.complexity.description=Reports on complexity, average complexity and complexity distribution.
widget.complexity.per_method.suffix=\ /method
--- /dev/null
+<%
+ duplications=measure('duplicated_lines_density')
+ if duplications
+%>
+<table width="100%">
+ <tbody>
+ <tr>
+ <td valign="top" width="50%">
+ <div class="dashbox">
+ <p class="title"><%= message('widget.duplications.duplications') -%></p>
+ <p>
+ <span class="big">
+ <%= format_measure('duplicated_lines_density',:url => url_for_drilldown('duplicated_lines_density'))%></span>
+ <%= dashboard_configuration.selected_period? ? format_variation('duplicated_lines_density') : trend_icon('duplicated_lines_density') -%>
+ </span>
+ </p>
+ <p>
+ <%= format_measure(measure('duplicated_lines'),:url => url_for_drilldown('duplicated_lines'), :suffix => ' ' + message('widget.duplications.lines.suffix'))%>
+ <%= dashboard_configuration.selected_period? ? format_variation('duplicated_lines') : trend_icon('duplicated_lines') -%>
+ </p>
+ <p>
+ <%= format_measure(measure('duplicated_blocks'),:url => url_for_drilldown('duplicated_blocks'), :suffix => ' ' + message('widget.duplications.blocks.suffix'))%>
+ <%= dashboard_configuration.selected_period? ? format_variation('duplicated_blocks') : trend_icon('duplicated_blocks') -%>
+ </p>
+ <p>
+ <%= format_measure(measure('duplicated_files'),:url => url_for_drilldown('duplicated_files'), :suffix => ' ' + message('widget.duplications.files.suffix'))%>
+ <%= dashboard_configuration.selected_period? ? format_variation('duplicated_files') : trend_icon('duplicated_files') -%>
+ </p>
+ </div>
+ </td>
+<%
+ useless_code=measure('total-useless-lines')
+ if useless_code
+%>
+
+ <td valign="top" width="50%">
+ <div class="dashbox">
+ <p class="title"><%= message('widget.duplications.useless-duplications-title') -%></p>
+ <p>
+ <span class="big">
+ <%= format_measure(measure('useless-duplicated-lines'),:url => url_for_drilldown('useless-duplicated-lines'), :suffix => ' ' + message('widget.duplications.lines.suffix'))%>
+ </span>
+ <%= dashboard_configuration.selected_period? ? format_variation('useless-duplicated-lines') : trend_icon('useless-duplicated-lines') -%>
+ </p>
+ </div>
+ </td>
+<%
+ end
+%>
+ </tr>
+ </tbody>
+</table>
+<%
+ end
+%>