]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6860 Add the "technical debt ratio on new code" measure in the "Technical Debt...
authorStas Vilchik <vilchiks@gmail.com>
Mon, 28 Sep 2015 08:39:13 +0000 (10:39 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 28 Sep 2015 08:46:40 +0000 (10:46 +0200)
server/sonar-server/src/main/resources/org/sonar/server/dashboard/widget/debt_overview.erb
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 87cceb5ff3b73fdc3691370d3ba8e35548f07702..2b9163ad0bd5bab1baf2a1b3dffae2a1ff243ed8 100644 (file)
@@ -3,31 +3,44 @@
    sqale_debt_ratio = @snapshot.measure('sqale_debt_ratio')
    if sqale_rating && sqale_rating.text_value && sqale_debt_ratio
 %>
-  <% if sqale_rating && sqale_rating.text_value %>
-    <div class="widget-row">
+  <div class="widget-row">
+    <% if sqale_rating && sqale_rating.text_value %>
       <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">
-              <%= format_measure(sqale_rating, :url => url_for_drilldown(sqale_rating)) %>
+              <%= format_measure(sqale_rating,sqaleOverview :url => url_for_drilldown(sqale_rating)) %>
             </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)) %>
-            <%= format_variation(sqale_debt_ratio) if dashboard_configuration.selected_period? -%>
-          </span>
+    <% 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)) %>
+              <%= format_variation(sqale_debt_ratio) if dashboard_configuration.selected_period? -%>
+            </span>
+          </div>
+          <% if dashboard_configuration.selected_period? %>
+            <% new_sqale_debt_ratio = @snapshot.measure('new_sqale_debt_ratio') %>
+            <% if new_sqale_debt_ratio %>
+              <div class="widget-measure widget-measure-main">
+                <span class="widget-label"><%= message('widget.debt_overview.on_new_code') -%></span>
+                <span class="nowrap">
+                  <%= format_measure(new_sqale_debt_ratio,
+                                     :period => dashboard_configuration.period_index,
+                                     :url => url_for_drilldown('new_sqale_debt_ratio', :period => dashboard_configuration.period_index)) %>
+                </span>
+              </div>
+            <% end %>
+          <% end %>
         </div>
       </div>
-    </div>
-    </div>
-  <% end %>
+    <% end %>
+  </div>
 <% end %>
index 45bb035fc6c4fb9bd8773155254324735c410046..a8fed1ceb925f6877ebb82370ab6ff824bc0ac6c 100644 (file)
@@ -1445,6 +1445,7 @@ 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.
+widget.debt_overview.on_new_code=On New Code
 
 # Below are labels used in widget edition pages
 widget.image.name=Image