Commit 64f6a39390d8c2da63431ecf0708abffb4fb68d1
1 parent
1d2b4e54
Exists in
master
and in
28 other branches
Fix metric entities and fixtures
Showing
4 changed files
with
14 additions
and
13 deletions
Show diff stats
plugins/mezuro/lib/kalibro/entities/metric.rb
| 1 | 1 | class Kalibro::Entities::Metric < Kalibro::Entities::Entity |
| 2 | 2 | |
| 3 | - attr_accessor :name, :scope, :description, :id | |
| 4 | - | |
| 5 | - def initialize name, scope, description, id | |
| 6 | - @name = name | |
| 7 | - @scope = scope | |
| 8 | - @description = description | |
| 9 | - @id = id | |
| 10 | - end | |
| 3 | + attr_accessor :name, :scope, :description | |
| 11 | 4 | |
| 12 | 5 | end | ... | ... |
plugins/mezuro/lib/kalibro/entities/native_metric.rb
| ... | ... | @@ -2,4 +2,12 @@ class Kalibro::Entities::NativeMetric < Kalibro::Entities::Metric |
| 2 | 2 | |
| 3 | 3 | attr_accessor :origin, :language |
| 4 | 4 | |
| 5 | + def languages | |
| 6 | + @language | |
| 7 | + end | |
| 8 | + | |
| 9 | + def languages=(languages) | |
| 10 | + @language = languages | |
| 11 | + end | |
| 12 | + | |
| 5 | 13 | end |
| 6 | 14 | \ No newline at end of file | ... | ... |
plugins/mezuro/test/fixtures/native_metric_fixtures.rb
| ... | ... | @@ -5,12 +5,12 @@ class NativeMetricFixtures |
| 5 | 5 | total_cof.name = 'Total Coupling Factor' |
| 6 | 6 | total_cof.scope = 'APPLICATION' |
| 7 | 7 | total_cof.origin = 'Analizo' |
| 8 | - total_cof.language = 'JAVA' | |
| 8 | + total_cof.languages = ['JAVA'] | |
| 9 | 9 | total_cof |
| 10 | 10 | end |
| 11 | 11 | |
| 12 | 12 | def self.total_cof_hash |
| 13 | - {:name => 'Total Coupling Factor', :scope => 'APPLICATION', :origin => 'Analizo', :language => 'JAVA'} | |
| 13 | + {:name => 'Total Coupling Factor', :scope => 'APPLICATION', :origin => 'Analizo', :language => ['JAVA']} | |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | 16 | def self.amloc |
| ... | ... | @@ -18,12 +18,12 @@ class NativeMetricFixtures |
| 18 | 18 | total_cof.name = 'Average Method LOC' |
| 19 | 19 | total_cof.scope = 'CLASS' |
| 20 | 20 | total_cof.origin = 'Analizo' |
| 21 | - total_cof.language = 'JAVA' | |
| 21 | + total_cof.languages = ['JAVA'] | |
| 22 | 22 | total_cof |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | def self.amloc_hash |
| 26 | - {:name => 'Average Method LOC', :scope => 'CLASS', :origin => 'Analizo', :language => 'JAVA'} | |
| 26 | + {:name => 'Average Method LOC', :scope => 'CLASS', :origin => 'Analizo', :language => ['JAVA']} | |
| 27 | 27 | end |
| 28 | 28 | |
| 29 | 29 | end |
| 30 | 30 | \ No newline at end of file | ... | ... |
plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb