From 09b24df6e048845be5ba44ad4ee1bff1ecd9daf1 Mon Sep 17 00:00:00 2001 From: Carlos Morais + Paulo Meirelles Date: Mon, 9 Jan 2012 14:38:07 -0200 Subject: [PATCH] Showing source tree --- plugins/mezuro/lib/kalibro/entities/module_node.rb | 25 +++++++++++++++++++++++++ plugins/mezuro/views/content_viewer/show_project.rhtml | 102 ++++++++++++------------------------------------------------------------------------------------------ 2 files changed, 37 insertions(+), 90 deletions(-) diff --git a/plugins/mezuro/lib/kalibro/entities/module_node.rb b/plugins/mezuro/lib/kalibro/entities/module_node.rb index 447a231..9f37274 100644 --- a/plugins/mezuro/lib/kalibro/entities/module_node.rb +++ b/plugins/mezuro/lib/kalibro/entities/module_node.rb @@ -18,4 +18,29 @@ class Kalibro::Entities::ModuleNode < Kalibro::Entities::Entity @child = children end + def print + cell = "#{@module.name} (#{@module.granularity})" + return "" + cell + "
" if @child.nil? + + id = @module.name + "" + + "" + + "" + + cell + + "" + + "" + + "" + + "" + + "" + + "
" + + "" + + "" + + "
" + + @child.collect { |child| child.print }.to_s + + "
" + end + end \ No newline at end of file diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml index f6c64c7..1017ca9 100644 --- a/plugins/mezuro/views/content_viewer/show_project.rhtml +++ b/plugins/mezuro/views/content_viewer/show_project.rhtml @@ -2,27 +2,27 @@ - + - + - + - + - + - +
<%= _("Name") %><%= _('Name') %> <%= @project.name %>
<%= _("License") %><%= _('License') %> <%= @project.license %>
<%= _("Description") %><%= _('Description') %> <%= @project.description %>
<%= _("Repository type") %><%= _('Repository type') %> <%= @project.repository.type %>
<%= _("Repository address") %><%= _('Repository address') %> <%= @project.repository.address %>
<%= _("Configuration") %><%= _('Configuration') %> <%= @project.configuration_name %>
@@ -44,103 +44,25 @@

<%= _("Kalibro Service is #{@project.state.downcase} the source code.") %>
- <%= _("Reload the page manually in a few moments.") %> + <%= _('Reload the page manually in a few moments.') %>

<% elsif @project.state == 'READY' %>

<%= _('LAST RESULT') %>

<% @project_result = Kalibro::Client::ProjectResultClient.new.last_result(@project.name) %> - + - + - +
<%= _("Date") %><%= _('Date') %> <%= @project_result.date %>
<%= _("Load time") %><%= _('Load time') %> <%= @project_result.formatted_load_time %>
<%= _("Analysis time") %><%= _('Analysis time') %> <%= @project_result.formatted_analysis_time %>
+
<%= _('Source tree') %>
+ <%= @project_result.source_tree.print %> <% end %> - - -<%# if @project.state == 'READY' %> - - <%# if @project.configuration.nil? %> - <%# metric_results = @client.last_module_result(@project.name).metric_results %> - - <%#*

%> - <%#= _("Total Metrics") %> - <%#*

%> - <%#*%> - <%# total_results = metric_results.each.select {|result| result.native_metric.scope == 'APPLICATION'} %> - <%# total_results.each_with_index do |result, index| %> - <%#*%> - <%#*%> - <%#*%> - <%#*%> - <%# end %> - <%#*
%> - <%#= result.native_metric.name %> - <%#*%> - <%#= result.value %> - <%#*
%> - - <%#*

%> - <%#= _("Statistical Metrics") %> - <%#*

%> - <%# statistical_results = metric_results.each.select {|result| result.native_metric.scope == 'CLASS'} %> - <%# statistical_results.each do |result| %> - <%#*
%> - - <%#*%> - <%#*%> - <%#*%> - <%#*%> - <%#*%> - <%# result.available_statistics.each_with_index do |statistic, index| %> - <%#*%> - <%#*%> - <%#*%> - <%#*%> - <%# end %> - <%#*
%> - <%#* - <%#*onclick="collapse('<%= @project.name >_<%= result.native_metric.code >')"%> - <%#*alt="+" src="/plugins/mezuro/images/plus.png" class="collapsable"/>%> - <%#* - <%#*onclick="collapse('<%= @project.name >_<%= result.native_metric.code >')"%> - <%#*alt="-" src="/plugins/mezuro/images/minus.png" class="collapsable"/>%> - <%#= "#{result.native_metric.name}" %> - <%#*%> - <%#= "#{result.average}"%> - <%#*
%> - <%#*
%> - <%# end %> - - <%# else %> - <%# metric_results = @client.last_module_result(@project.name).compiled_metric_results %> - - <%#*

%> - <%#= _("Metrics") %> - <%#*

%> - <%#*%> - <%# metric_results.each do |result| %> - <%#*%> - <%#*%> - <%#*%> - <%#*%> - <%# end %> - <%#*
%> - <%#= result.native_metric.name %> - <%#*%> - <%#= result.value %> - <%#*
%> - <%# end %> -<%# end %> -- libgit2 0.21.2