ruby-watchr 0.1.7 → 0.1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,7 +37,7 @@ module Watchr
37
37
  add_smell(
38
38
  Watchr::Smell.new(
39
39
  get_smell_level?(target, type),
40
- target.name, '', target.location, {:score => target.total_score}
40
+ target.name, "complexity = #{target.total_score}", target.location
41
41
  )
42
42
  ) if target.total_score >= get_threshold(:complex, type.upcase)
43
43
  end
data/lib/watchr/smell.rb CHANGED
@@ -4,7 +4,7 @@ module Watchr
4
4
  class Smell
5
5
  include SmellTypes
6
6
 
7
- def initialize(type, context, description, locations, options)
7
+ def initialize(type, context, description, locations, options = {})
8
8
  @type = type
9
9
  @context = context
10
10
  @description = description
@@ -1,3 +1,3 @@
1
1
  module Watchr
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.7.1"
3
3
  end
@@ -49,9 +49,8 @@ describe Watchr::Analysers::Flog do
49
49
  Watchr::Smell.expects(:new).with(
50
50
  :complex_method,
51
51
  complex_method.name,
52
- '',
53
- complex_method.location,
54
- { :score => complex_method.total_score }
52
+ "complexity = #{complex_method.total_score}",
53
+ complex_method.location
55
54
  )
56
55
 
57
56
  analyse.expects(:add_smell).returns(smell)
@@ -63,9 +62,8 @@ describe Watchr::Analysers::Flog do
63
62
  Watchr::Smell.expects(:new).with(
64
63
  :very_complex_method,
65
64
  very_complex_method.name,
66
- '',
67
- very_complex_method.location,
68
- { :score => very_complex_method.total_score }
65
+ "complexity = #{very_complex_method.total_score}",
66
+ very_complex_method.location
69
67
  )
70
68
 
71
69
  analyse.expects(:add_smell).returns(smell)
@@ -77,9 +75,8 @@ describe Watchr::Analysers::Flog do
77
75
  Watchr::Smell.expects(:new).with(
78
76
  :very_complex_object,
79
77
  clazz.name,
80
- '',
81
- clazz.location,
82
- { :score => clazz.total_score }
78
+ "complexity = #{clazz.total_score}",
79
+ clazz.location
83
80
  )
84
81
 
85
82
  analyse.expects(:add_smell).returns(smell)
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 1
8
8
  - 7
9
- version: 0.1.7
9
+ - 1
10
+ version: 0.1.7.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Petr Janda