diff options
author | David Gageot <david@gageot.net> | 2012-10-31 13:04:32 +0100 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-31 13:04:32 +0100 |
commit | 83959c79ce06a9ace277ecac98dfad05c61e4db8 (patch) | |
tree | 1211845ccab44df955c97d564994c9b6b6a5bb94 | |
parent | 833cf2e19ec89cbc4a8f75d9a5129e359f11a7cd (diff) | |
download | sonarqube-83959c79ce06a9ace277ecac98dfad05c61e4db8.tar.gz sonarqube-83959c79ce06a9ace277ecac98dfad05c61e4db8.zip |
SONAR-3890 the overall code coverage should not be computed when the code coverage by unit tests is not computed with jacoco
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/resource/_header_coverage.html.erb | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_header_coverage.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_header_coverage.html.erb index 92fc0e28297..d77ccca66ef 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_header_coverage.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_header_coverage.html.erb @@ -6,26 +6,60 @@ <% end -%> <table class="coverage"> - <% [('overall_' if @display_overall_coverage), '', ('it_' if @display_it_coverage)].compact.each_with_index do |prefix, index| -%> + <% if @display_overall_coverage -%> <tr> - <% if index == 0 -%> - <td class="right big" style="width: 60px;"><%= format(new, prefix, 'coverage', :span => true) -%></td> - <td></td> + <td class="right big" style="width: 60px;"><%= format(new, 'overall_', 'coverage', :span => true) -%></td> + <td></td> + <td class="name"><%= h Metric.name_for('line_coverage') -%>:</td> + <td class="value"> + <%= format(new, 'overall_', 'line_coverage') -%> <%= format_ratio(new, 'overall_', 'lines_to_cover', 'uncovered_lines') -%> + </td> + <td class="sep"></td> + <td class="name"><%= h Metric.name_for('branch_coverage') -%>:</td> + <td class="value"> + <%= format(new, 'overall_', 'branch_coverage') -%> <%= format_ratio(new, 'overall_', 'conditions_to_cover', 'uncovered_conditions') -%> + </td> + </tr> + <% end -%> + + <tr> + <td class="right value"><%= format(new, '', 'coverage', :span => true) -%></td> + <td><%= message('coverage_viewer.by') -%></td> + <% if @display_overall_coverage -%> + <td colspan="2"></td> + <td class="sep"></td> + <td colspan="2"></td> + <% else -%> + <td class="name"><%= h Metric.name_for('line_coverage') -%>:</td> + <td class="value"> + <%= format(new, '', 'line_coverage') -%> <%= format_ratio(new, '', 'lines_to_cover', 'uncovered_lines') -%> + </td> + <td class="sep"></td> + <td class="name"><%= h Metric.name_for('branch_coverage') -%>:</td> + <td class="value"> + <%= format(new, '', 'branch_coverage') -%> <%= format_ratio(new, '', 'conditions_to_cover', 'uncovered_conditions') -%> + </td> + <% end -%> + </tr> + + <% if @display_it_coverage -%> + <tr> + <td class="right value"><%= format(new, 'it_', 'coverage', :span => true) -%></td> + <td><%= message('it_' + 'coverage_viewer.by') -%></td> + <% if @display_overall_coverage -%> + <td colspan="2"></td> + <td class="sep"></td> + <td colspan="2"></td> + <% else -%> <td class="name"><%= h Metric.name_for('line_coverage') -%>:</td> <td class="value"> - <%= format(new, prefix, 'line_coverage') -%> <%= format_ratio(new, prefix, 'lines_to_cover', 'uncovered_lines') -%> + <%= format(new, 'it_', 'line_coverage') -%> <%= format_ratio(new, 'it_', 'lines_to_cover', 'uncovered_lines') -%> </td> <td class="sep"></td> <td class="name"><%= h Metric.name_for('branch_coverage') -%>:</td> <td class="value"> - <%= format(new, prefix, 'branch_coverage') -%> <%= format_ratio(new, prefix, 'conditions_to_cover', 'uncovered_conditions') -%> + <%= format(new, 'it_', 'branch_coverage') -%> <%= format_ratio(new, 'it_', 'conditions_to_cover', 'uncovered_conditions') -%> </td> - <% else -%> - <td class="right value"><%= format(new, prefix, 'coverage', :span => true) -%></td> - <td><%= message(prefix + 'coverage_viewer.by') -%></td> - <td colspan="2"></td> - <td class="sep"></td> - <td colspan="2"></td> <% end -%> </tr> <% end -%> |