MeasureFilterAsHistogramWidget.class,
MeasureFilterAsBubbleChartWidget.class,
ProjectFileCloudWidget.class,
+ DebtOverviewWidget.class,
// dashboards
ProjectDefaultDashboard.class,
}
private void addSecondColumn(Dashboard dashboard) {
- dashboard.addWidget("technical_debt", 2);
+ dashboard.addWidget("debt_overview", 2);
dashboard.addWidget("rules", 2);
dashboard.addWidget("alerts", 2);
dashboard.addWidget("file_design", 2);
--- /dev/null
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 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.UserRole;
+import org.sonar.api.web.WidgetCategory;
+
+@UserRole(UserRole.USER)
+@WidgetCategory("Technical Debt")
+public final class DebtOverviewWidget extends CoreWidget {
+
+ public DebtOverviewWidget() {
+ super("debt_overview", "Technical Debt Overview", "/org/sonar/plugins/core/widgets/debt_overview.erb");
+ }
+}
--- /dev/null
+<%
+ sqale_rating = @snapshot.measure('sqale_rating')
+ sqale_debt_ratio = @snapshot.measure('sqale_debt_ratio')
+ if sqale_rating && sqale_rating.text_value && sqale_debt_ratio
+%>
+ <style>
+ .debt_overview .rating {
+ padding: 2px 5px;
+ color: #fff;
+ }
+
+ .debt_overview .A {
+ background-color: #00AA00;
+ }
+
+ .debt_overview .B {
+ background-color: #80CC00;
+ }
+
+ .debt_overview .C {
+ background-color: #FFEE00;
+ }
+
+ .debt_overview .D {
+ background-color: #F77700;
+ }
+
+ .debt_overview .E {
+ background-color: #EE0000;
+ }
+ </style>
+ <% if sqale_rating && sqale_rating.text_value %>
+ <div class="widget-row">
+ <div class="widget-span widget-span-6">
+ <div class="widget-measure-container">
+ <div class="widget-measure widget-measure-main">
+ <span class="widget-label"><%= message('metric.sqale_rating.name') -%></span>
+ <span class="nowrap">
+ <a href="<%= url_for_drilldown('sqale_rating') -%>" class="widget-link">
+ <span class="rating <%= sqale_rating.text_value -%>"><%= sqale_rating.text_value -%></span>
+ </a>
+ <% unless dashboard_configuration.selected_period? %>
+ <%= trend_icon(sqale_rating) -%>
+ <% end %>
+ </span>
+ </div>
+ </div>
+ </div>
+ <% end %>
+ <% if sqale_debt_ratio %>
+ <div class="widget-span widget-span-6">
+ <div class="widget-measure-container">
+ <div class="widget-measure widget-measure-main">
+ <span class="widget-label"><%= message('metric.sqale_debt_ratio.name') -%></span>
+ <span class="nowrap">
+ <%= format_measure(sqale_debt_ratio, :url => url_for_drilldown(sqale_debt_ratio)) %>
+ <%= dashboard_configuration.selected_period? ? format_variation(sqale_debt_ratio) : trend_icon(sqale_debt_ratio) -%>
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <% end %>
+<% end %>
widget.technical_debt_pyramid.total=Total
widget.technical_debt_pyramid.no_info_available=No information available.
+widget.debt_overview.name=Technical Debt Synopsis
+widget.debt_overview.description=Display the SQALE rating and the technical debt ratio.
+
# Below are labels used in widget edition pages
widget.image.name=Image
widget.image.description=Shows an image with a link
metric.sqale_rating.name=SQALE Rating
metric.sqale_rating.description=Density of technical debt computed by dividing the technical debt by the estimated effort to develop from scratch an application.
-metric.sqale_debt_ratio.name=SQALE Technical Debt Ratio
+metric.sqale_debt_ratio.name=Technical Debt Ratio
metric.sqale_debt_ratio.description=Ratio of the technical debt compared to what it would cost to develop the whole source code from scratch.