]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2804 Fix metrics category names and order
authorDavid Gageot <david@gageot.net>
Wed, 10 Oct 2012 08:13:04 +0000 (10:13 +0200)
committerDavid Gageot <david@gageot.net>
Wed, 10 Oct 2012 08:13:04 +0000 (10:13 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb

index fd65fb460a0b00d444db4564dca7d23711942966..1017eb48f059e6ad57e349253607a428ac341c99 100644 (file)
@@ -39,8 +39,8 @@ public final class CoreMetrics {
 
   public static final String DOMAIN_SIZE = "Size";
   public static final String DOMAIN_TESTS = "Tests";
-  public static final String DOMAIN_INTEGRATION_TESTS = "Integration Tests";
-  public static final String DOMAIN_OVERALL_TESTS = "All Tests";
+  public static final String DOMAIN_INTEGRATION_TESTS = "Tests (Integration)";
+  public static final String DOMAIN_OVERALL_TESTS = "Tests (Overall)";
   public static final String DOMAIN_COMPLEXITY = "Complexity";
   public static final String DOMAIN_DOCUMENTATION = "Documentation";
   public static final String DOMAIN_RULES = "Rules";
index 11b71dc084c23e7d84de1035387709c4d77bb492..6a78bb2c82857acafec1fe98ccbbe5c07aa462c2 100644 (file)
@@ -184,8 +184,8 @@ class ResourceController < ApplicationController
       @coverage_filter = (metric ? metric.key : 'coverage')
 
       it_prefix = ''
-      it_prefix = 'it_' if @coverage_filter.start_with?('it_')
-      it_prefix = 'overall_' if @coverage_filter.start_with?('overall_')
+      it_prefix = 'it_' if (@coverage_filter.start_with?('it_') || @coverage_filter.start_with?('new_it_'))
+      it_prefix = 'overall_' if (@coverage_filter.start_with?('overall_') || @coverage_filter.start_with?('new_overall_'))
 
       @hits_by_line = load_distribution("#{it_prefix}coverage_line_hits_data")
       @conditions_by_line = load_distribution("#{it_prefix}conditions_by_line")
index 8da520a23c20fd885f63b52789565a0f67a8edcb..34d774f440cac74fd7e5b7bcf1ef648819d89be8 100644 (file)
           <% if @display_coverage %>
             <td class="<%= 'first' if first -%>">
               <select id="coverage_filter" name="coverage_filter" onchange="applyOptions()">
-                <% if @display_overall_coverage %>
-                  <optgroup label="<%= h message('coverage_viewer.overall_tests') -%>">
-                    <option value="overall_lines_to_cover" <%= 'selected' if @coverage_filter=='overall_lines_to_cover' -%>><%= Metric.name_for('overall_lines_to_cover') -%></option>
-                    <option value="overall_uncovered_lines" <%= 'selected' if @coverage_filter=='overall_uncovered_lines' -%>><%= Metric.name_for('overall_uncovered_lines') -%></option>
-                    <option value="overall_conditions_to_cover" <%= 'selected' if @coverage_filter=='overall_conditions_to_cover' -%>><%= Metric.name_for('overall_conditions_to_cover') -%></option>
-                    <option value="overall_uncovered_conditions" <%= 'selected' if @coverage_filter=='overall_uncovered_conditions' -%>><%= Metric.name_for('overall_uncovered_conditions') -%></option>
-                  </optgroup>
-                <% end %>
                 <optgroup label="<%= h message('coverage_viewer.unit_tests') -%>">
                   <option value="lines_to_cover" <%= 'selected' if @coverage_filter=='lines_to_cover' -%>><%= Metric.name_for('lines_to_cover') -%></option>
                   <option value="uncovered_lines" <%= 'selected' if @coverage_filter=='uncovered_lines' -%>><%= Metric.name_for('uncovered_lines') -%></option>
                     <option value="it_uncovered_conditions" <%= 'selected' if @coverage_filter=='it_uncovered_conditions' -%>><%= Metric.name_for('it_uncovered_conditions') -%></option>
                   </optgroup>
                 <% end %>
+                <% if @display_overall_coverage %>
+                  <optgroup label="<%= h message('coverage_viewer.overall_tests') -%>">
+                    <option value="overall_lines_to_cover" <%= 'selected' if @coverage_filter=='overall_lines_to_cover' -%>><%= Metric.name_for('overall_lines_to_cover') -%></option>
+                    <option value="overall_uncovered_lines" <%= 'selected' if @coverage_filter=='overall_uncovered_lines' -%>><%= Metric.name_for('overall_uncovered_lines') -%></option>
+                    <option value="overall_conditions_to_cover" <%= 'selected' if @coverage_filter=='overall_conditions_to_cover' -%>><%= Metric.name_for('overall_conditions_to_cover') -%></option>
+                    <option value="overall_uncovered_conditions" <%= 'selected' if @coverage_filter=='overall_uncovered_conditions' -%>><%= Metric.name_for('overall_uncovered_conditions') -%></option>
+                  </optgroup>
+                <% end %>
               </select>
             </td>
           <% first=false