Commit 09b24df6e048845be5ba44ad4ee1bff1ecd9daf1
Committed by
Paulo Meireles
1 parent
8d141577
Exists in
master
and in
28 other branches
Showing source tree
Showing
2 changed files
with
37 additions
and
90 deletions
Show diff stats
plugins/mezuro/lib/kalibro/entities/module_node.rb
| @@ -18,4 +18,29 @@ class Kalibro::Entities::ModuleNode < Kalibro::Entities::Entity | @@ -18,4 +18,29 @@ class Kalibro::Entities::ModuleNode < Kalibro::Entities::Entity | ||
| 18 | @child = children | 18 | @child = children |
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | + def print | ||
| 22 | + cell = "<td>#{@module.name} (#{@module.granularity})</td>" | ||
| 23 | + return "<table><tr><td width=\"1\"></td>" + cell + "</tr></table>" if @child.nil? | ||
| 24 | + | ||
| 25 | + id = @module.name | ||
| 26 | + "<table>" + | ||
| 27 | + "<tr>" + | ||
| 28 | + "<td width=\"1\">" + | ||
| 29 | + "<img id=\"#{id}_plus\" onclick=\"toogle('#{id}')\"" + | ||
| 30 | + "alt=\"+\" src=\"/plugins/mezuro/images/plus.png\" class=\"link\"/>" + | ||
| 31 | + "<img id=\"#{id}_minus\" onclick=\"toogle('#{id}')\"" + | ||
| 32 | + "alt=\"-\" src=\"/plugins/mezuro/images/minus.png\" class=\"link\"" + | ||
| 33 | + "style=\"display: none\"/>" + | ||
| 34 | + "</td>" + | ||
| 35 | + cell + | ||
| 36 | + "</tr>" + | ||
| 37 | + "<tr id=\"#{id}_hidden\" style=\"display: none\">" + | ||
| 38 | + "<td></td>" + | ||
| 39 | + "<td style=\"text-align: left\">" + | ||
| 40 | + @child.collect { |child| child.print }.to_s + | ||
| 41 | + "</td>" + | ||
| 42 | + "</tr>" + | ||
| 43 | + "</table>" | ||
| 44 | + end | ||
| 45 | + | ||
| 21 | end | 46 | end |
| 22 | \ No newline at end of file | 47 | \ No newline at end of file |
plugins/mezuro/views/content_viewer/show_project.rhtml
| @@ -2,27 +2,27 @@ | @@ -2,27 +2,27 @@ | ||
| 2 | 2 | ||
| 3 | <table id="project_info"> | 3 | <table id="project_info"> |
| 4 | <tr> | 4 | <tr> |
| 5 | - <td><%= _("Name") %></td> | 5 | + <td><%= _('Name') %></td> |
| 6 | <td><%= @project.name %></td> | 6 | <td><%= @project.name %></td> |
| 7 | </tr> | 7 | </tr> |
| 8 | <tr> | 8 | <tr> |
| 9 | - <td><%= _("License") %></td> | 9 | + <td><%= _('License') %></td> |
| 10 | <td><%= @project.license %></td> | 10 | <td><%= @project.license %></td> |
| 11 | </tr> | 11 | </tr> |
| 12 | <tr> | 12 | <tr> |
| 13 | - <td><%= _("Description") %></td> | 13 | + <td><%= _('Description') %></td> |
| 14 | <td><%= @project.description %></td> | 14 | <td><%= @project.description %></td> |
| 15 | </tr> | 15 | </tr> |
| 16 | <tr> | 16 | <tr> |
| 17 | - <td><%= _("Repository type") %></td> | 17 | + <td><%= _('Repository type') %></td> |
| 18 | <td><%= @project.repository.type %></td> | 18 | <td><%= @project.repository.type %></td> |
| 19 | </tr> | 19 | </tr> |
| 20 | <tr> | 20 | <tr> |
| 21 | - <td><%= _("Repository address") %></td> | 21 | + <td><%= _('Repository address') %></td> |
| 22 | <td><%= @project.repository.address %></td> | 22 | <td><%= @project.repository.address %></td> |
| 23 | </tr> | 23 | </tr> |
| 24 | <tr> | 24 | <tr> |
| 25 | - <td><%= _("Configuration") %></td> | 25 | + <td><%= _('Configuration') %></td> |
| 26 | <td><%= @project.configuration_name %></td> | 26 | <td><%= @project.configuration_name %></td> |
| 27 | </tr> | 27 | </tr> |
| 28 | </table> | 28 | </table> |
| @@ -44,103 +44,25 @@ | @@ -44,103 +44,25 @@ | ||
| 44 | <p> | 44 | <p> |
| 45 | <%= _("Kalibro Service is #{@project.state.downcase} the source code.") %> | 45 | <%= _("Kalibro Service is #{@project.state.downcase} the source code.") %> |
| 46 | <br/> | 46 | <br/> |
| 47 | - <%= _("Reload the page manually in a few moments.") %> | 47 | + <%= _('Reload the page manually in a few moments.') %> |
| 48 | </p> | 48 | </p> |
| 49 | <% elsif @project.state == 'READY' %> | 49 | <% elsif @project.state == 'READY' %> |
| 50 | <h3><%= _('LAST RESULT') %></h3> | 50 | <h3><%= _('LAST RESULT') %></h3> |
| 51 | <% @project_result = Kalibro::Client::ProjectResultClient.new.last_result(@project.name) %> | 51 | <% @project_result = Kalibro::Client::ProjectResultClient.new.last_result(@project.name) %> |
| 52 | <table id="project_result_info"> | 52 | <table id="project_result_info"> |
| 53 | <tr> | 53 | <tr> |
| 54 | - <td><%= _("Date") %></td> | 54 | + <td><%= _('Date') %></td> |
| 55 | <td><%= @project_result.date %></td> | 55 | <td><%= @project_result.date %></td> |
| 56 | </tr> | 56 | </tr> |
| 57 | <tr> | 57 | <tr> |
| 58 | - <td><%= _("Load time") %></td> | 58 | + <td><%= _('Load time') %></td> |
| 59 | <td><%= @project_result.formatted_load_time %></td> | 59 | <td><%= @project_result.formatted_load_time %></td> |
| 60 | </tr> | 60 | </tr> |
| 61 | <tr> | 61 | <tr> |
| 62 | - <td><%= _("Analysis time") %></td> | 62 | + <td><%= _('Analysis time') %></td> |
| 63 | <td><%= @project_result.formatted_analysis_time %></td> | 63 | <td><%= @project_result.formatted_analysis_time %></td> |
| 64 | </tr> | 64 | </tr> |
| 65 | </table> | 65 | </table> |
| 66 | + <h5><%= _('Source tree') %></h5> | ||
| 67 | + <%= @project_result.source_tree.print %> | ||
| 66 | <% end %> | 68 | <% end %> |
| 67 | - | ||
| 68 | - | ||
| 69 | -<%# if @project.state == 'READY' %> | ||
| 70 | - | ||
| 71 | - <%# if @project.configuration.nil? %> | ||
| 72 | - <%# metric_results = @client.last_module_result(@project.name).metric_results %> | ||
| 73 | - | ||
| 74 | - <%#*<h3>%> | ||
| 75 | - <%#= _("Total Metrics") %> | ||
| 76 | - <%#*</h3>%> | ||
| 77 | - <%#*<table id="total_metrics">%> | ||
| 78 | - <%# total_results = metric_results.each.select {|result| result.native_metric.scope == 'APPLICATION'} %> | ||
| 79 | - <%# total_results.each_with_index do |result, index| %> | ||
| 80 | - <%#*<tr id="tr_<%= result.native_metric.code >" class="d<%= index % 2 >">%> | ||
| 81 | - <%#*<td>%> | ||
| 82 | - <%#= result.native_metric.name %> | ||
| 83 | - <%#*</td>%> | ||
| 84 | - <%#*<td class="metric_box">%> | ||
| 85 | - <%#= result.value %> | ||
| 86 | - <%#*</td>%> | ||
| 87 | - <%#*</tr>%> | ||
| 88 | - <%# end %> | ||
| 89 | - <%#*</table>%> | ||
| 90 | - | ||
| 91 | - <%#*<h3>%> | ||
| 92 | - <%#= _("Statistical Metrics") %> | ||
| 93 | - <%#*</h3>%> | ||
| 94 | - <%# statistical_results = metric_results.each.select {|result| result.native_metric.scope == 'CLASS'} %> | ||
| 95 | - <%# statistical_results.each do |result| %> | ||
| 96 | - <%#*<div id="statistical_metrics">%> | ||
| 97 | - | ||
| 98 | - <%#*<table id="<%= @project.name >_<%= result.native_metric.code >_list">%> | ||
| 99 | - <%#*<thead>%> | ||
| 100 | - <%#*<th>%> | ||
| 101 | - <%#*<img id="<%= @project.name >_<%= result.native_metric.code >_plus"%> | ||
| 102 | - <%#*onclick="collapse('<%= @project.name >_<%= result.native_metric.code >')"%> | ||
| 103 | - <%#*alt="+" src="/plugins/mezuro/images/plus.png" class="collapsable"/>%> | ||
| 104 | - <%#*<img id="<%= @project.name >_<%= result.native_metric.code >_minus" style="display: none"%> | ||
| 105 | - <%#*onclick="collapse('<%= @project.name >_<%= result.native_metric.code >')"%> | ||
| 106 | - <%#*alt="-" src="/plugins/mezuro/images/minus.png" class="collapsable"/>%> | ||
| 107 | - <%#= "#{result.native_metric.name}" %> | ||
| 108 | - <%#*</th>%> | ||
| 109 | - <%#*<th class="metric_box">%> | ||
| 110 | - <%#= "#{result.average}"%> | ||
| 111 | - <%#*</th>%> | ||
| 112 | - <%#*</thead>%> | ||
| 113 | - <%# result.available_statistics.each_with_index do |statistic, index| %> | ||
| 114 | - <%#*<tr class="d<%= index % 2 > statistic" style="display: none">%> | ||
| 115 | - <%#*<td>%> | ||
| 116 | - <%#= statistic %> | ||
| 117 | - <%#*</td>%> | ||
| 118 | - <%#*<td class="metric_box">%> | ||
| 119 | - <%#= result.statistic(statistic) %> | ||
| 120 | - <%#*</td>%> | ||
| 121 | - <%#*</tr>%> | ||
| 122 | - <%# end %> | ||
| 123 | - <%#*</table>%> | ||
| 124 | - <%#*</div>%> | ||
| 125 | - <%# end %> | ||
| 126 | - | ||
| 127 | - <%# else %> | ||
| 128 | - <%# metric_results = @client.last_module_result(@project.name).compiled_metric_results %> | ||
| 129 | - | ||
| 130 | - <%#*<h3>%> | ||
| 131 | - <%#= _("Metrics") %> | ||
| 132 | - <%#*</h3>%> | ||
| 133 | - <%#*<table id="metrics">%> | ||
| 134 | - <%# metric_results.each do |result| %> | ||
| 135 | - <%#*<tr id="tr_<%= result.native_metric.code >">%> | ||
| 136 | - <%#*<td>%> | ||
| 137 | - <%#= result.native_metric.name %> | ||
| 138 | - <%#*</td>%> | ||
| 139 | - <%#*<td class="metric_box">%> | ||
| 140 | - <%#= result.value %> | ||
| 141 | - <%#*</td>%> | ||
| 142 | - <%#*</tr>%> | ||
| 143 | - <%# end %> | ||
| 144 | - <%#*</table>%> | ||
| 145 | - <%# end %> | ||
| 146 | -<%# end %> |