Commit a3c5bceeb1da7287615a23e0857e1576998bdd01
Committed by
João M. M. da Silva
1 parent
d2957e16
Exists in
master
and in
29 other branches
[mezuro]Restarting in the right way
Showing
6 changed files
with
0 additions
and
79 deletions
Show diff stats
plugins/mezuro/lib/kalibro/client/configuration_client.rb
| ... | ... | @@ -4,7 +4,6 @@ class Kalibro::Client::ConfigurationClient |
| 4 | 4 | configuration = Kalibro::Entities::Configuration.new |
| 5 | 5 | configuration.name = configuration_content.name |
| 6 | 6 | configuration.description = configuration_content.description |
| 7 | - configuration.create_metric_configurations(configuration_content.metrics) | |
| 8 | 7 | new.save(configuration) |
| 9 | 8 | end |
| 10 | 9 | ... | ... |
plugins/mezuro/lib/kalibro/entities/configuration.rb
| ... | ... | @@ -2,8 +2,6 @@ class Kalibro::Entities::Configuration < Kalibro::Entities::Entity |
| 2 | 2 | |
| 3 | 3 | attr_accessor :name, :description, :metric_configuration |
| 4 | 4 | |
| 5 | - #FIXME Fix metric_configuration / metric_configurationS names | |
| 6 | - | |
| 7 | 5 | def metric_configuration=(value) |
| 8 | 6 | @metric_configuration = to_entity_array(value, Kalibro::Entities::MetricConfiguration) |
| 9 | 7 | end |
| ... | ... | @@ -23,14 +21,4 @@ class Kalibro::Entities::Configuration < Kalibro::Entities::Entity |
| 23 | 21 | end |
| 24 | 22 | end |
| 25 | 23 | |
| 26 | - def create_metric_configuration(metric) | |
| 27 | - splitted_metric = metric.split(/:/) | |
| 28 | - origin = splitted_metric[0] | |
| 29 | - name = splitted_metric[1] | |
| 30 | - metric = Kalibro::Entities::NativeMetric.new_with_origin_and_name(origin, name) | |
| 31 | - metric.scope = 'CLASS' | |
| 32 | - metric.languages = ['JAVA'] | |
| 33 | - Kalibro::Entities::MetricConfiguration.new_with_metric_and_code(metric, name) | |
| 34 | - end | |
| 35 | - | |
| 36 | 24 | end | ... | ... |
plugins/mezuro/lib/kalibro/entities/metric_configuration.rb
| ... | ... | @@ -2,23 +2,6 @@ class Kalibro::Entities::MetricConfiguration < Kalibro::Entities::Entity |
| 2 | 2 | |
| 3 | 3 | attr_accessor :metric, :code, :weight, :aggregation_form, :range |
| 4 | 4 | |
| 5 | - | |
| 6 | - def self.new_with_metric_and_code(metric, code) | |
| 7 | - configuration = new | |
| 8 | - configuration.metric = metric | |
| 9 | - configuration.code = code | |
| 10 | - configuration.ranges = [new_range] | |
| 11 | - configuration | |
| 12 | - end | |
| 13 | - | |
| 14 | - def self.new_range | |
| 15 | - created_range = Kalibro::Entities::Range.new | |
| 16 | - created_range.beginning = 0 | |
| 17 | - created_range.end = 10 | |
| 18 | - created_range.label = "" | |
| 19 | - created_range | |
| 20 | - end | |
| 21 | - | |
| 22 | 5 | def metric=(value) |
| 23 | 6 | if value.kind_of?(Hash) |
| 24 | 7 | @metric = to_entity(value, Kalibro::Entities::CompoundMetric) if value.has_key?(:script) | ... | ... |
plugins/mezuro/lib/kalibro/entities/native_metric.rb
| ... | ... | @@ -10,11 +10,4 @@ class Kalibro::Entities::NativeMetric < Kalibro::Entities::Metric |
| 10 | 10 | @language = languages |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | - def self.new_with_origin_and_name(origin, name) | |
| 14 | - metric = new | |
| 15 | - metric.name = name | |
| 16 | - metric.origin = origin | |
| 17 | - metric | |
| 18 | - end | |
| 19 | - | |
| 20 | 13 | end | ... | ... |
plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb
| ... | ... | @@ -18,25 +18,3 @@ end |
| 18 | 18 | <%= required f.text_field(:name) %> |
| 19 | 19 | |
| 20 | 20 | <%= f.text_field :description %><br/> |
| 21 | - | |
| 22 | -<h3>Metrics</h3> | |
| 23 | -<% @tool_names = Kalibro::Client::BaseToolClient.new | |
| 24 | -@tool_names.base_tool_names.each do |collector_name| %> | |
| 25 | - <h4><%=collector_name%></h4> | |
| 26 | - <table> | |
| 27 | - <% | |
| 28 | - @collector = @tool_names.base_tool(collector_name) | |
| 29 | - @collector.supported_metrics.each do |metric| | |
| 30 | - | |
| 31 | - metric_id = collector_name + ":" + metric.name %> | |
| 32 | - <tr class="metric" title="<%= metric.description %>"> | |
| 33 | - <td> | |
| 34 | - <% #FIXME Tratar caso com 0 métricas selecionadas %> | |
| 35 | - <%= check_box_tag "article[metrics][]", metric_id, false, {:id => metric_id.gsub(/[\/ ]/, '_')} %> | |
| 36 | - <%= label_tag metric_id, metric.name %> | |
| 37 | - </td> | |
| 38 | - </tr> | |
| 39 | - | |
| 40 | - <% end %> | |
| 41 | - </table> | |
| 42 | -<% end %> | ... | ... |
plugins/mezuro/views/content_viewer/show_configuration.rhtml
| ... | ... | @@ -14,23 +14,3 @@ |
| 14 | 14 | <%= link_to "Teste", "/profile/#{profile.identifier}/plugins/mezuro/teste" %> |
| 15 | 15 | <%= link_to "Teste", :controller => "mezuro_plugin_profile", :action => "teste", :params => {:configuration_name => |
| 16 | 16 | @configuration_content.name}%> |
| 17 | - | |
| 18 | -<h3>Metrics</h3> | |
| 19 | -<% @tool_names = Kalibro::Client::BaseToolClient.new | |
| 20 | -@tool_names.base_tool_names.each do |collector_name| %> | |
| 21 | - <h4><%=collector_name%></h4> | |
| 22 | - <table> | |
| 23 | - <% @configuration_content.metrics.each do |metric| | |
| 24 | - splitted_metric = metric.split(/:/) | |
| 25 | - metric_origin = splitted_metric[0] | |
| 26 | - metric_name = splitted_metric[1] | |
| 27 | - if( metric_origin == collector_name )%> | |
| 28 | - <tr class="metric" title="<%= metric_name %>"> | |
| 29 | - <td> | |
| 30 | - <%=metric_name%> | |
| 31 | - </td> | |
| 32 | - </tr> | |
| 33 | - <%end | |
| 34 | - end %> | |
| 35 | - </table> | |
| 36 | -<% end %> | ... | ... |