ruby-watchr 0.1.7 → 0.1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/watchr/analysers/flog.rb +1 -1
- data/lib/watchr/smell.rb +1 -1
- data/lib/watchr/version.rb +1 -1
- data/spec/watchr/analysers/flog_spec.rb +6 -9
- metadata +2 -1
@@ -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,
|
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
data/lib/watchr/version.rb
CHANGED
@@ -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)
|