@@ -21,7 +21,7 @@ def method_name
21
21
it 'registers an offense for an if modifier' do
22
22
expect_offense ( <<~RUBY )
23
23
def method_name
24
- ^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<0, 2, 1> 2.24/0]
24
+ ^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<0, 2, 1> 2.24/0]
25
25
call_foo if some_condition # 0 + 2*2 + 1*1
26
26
end
27
27
RUBY
@@ -30,7 +30,7 @@ def method_name
30
30
it 'registers an offense for an assignment of a local variable' do
31
31
offenses = expect_offense ( <<~RUBY )
32
32
def method_name
33
- ^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<1, 0, 0> 1/0]
33
+ ^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<1, 0, 0> 1/0]
34
34
x = 1
35
35
end
36
36
RUBY
@@ -41,7 +41,7 @@ def method_name
41
41
it 'registers an offense for an assignment of an element' do
42
42
expect_offense ( <<~RUBY )
43
43
def method_name
44
- ^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<1, 2, 0> 2.24/0]
44
+ ^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<1, 2, 0> 2.24/0]
45
45
x[0] = 1
46
46
end
47
47
RUBY
@@ -50,7 +50,7 @@ def method_name
50
50
it 'registers an offense for complex content including A, B, and C scores' do
51
51
expect_offense ( <<~RUBY )
52
52
def method_name
53
- ^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<3, 4, 5> 7.07/0]
53
+ ^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<3, 4, 5> 7.07/0]
54
54
my_options = Hash.new if 1 == 1 || 2 == 2 # 1, 1, 4
55
55
my_options.each do |key, value| # 2, 1, 1
56
56
p key # 0, 1, 0
@@ -63,7 +63,7 @@ def method_name
63
63
it 'registers an offense for a `define_method`' do
64
64
expect_offense ( <<~RUBY )
65
65
define_method :method_name do
66
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<1, 0, 0> 1/0]
66
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<1, 0, 0> 1/0]
67
67
x = 1
68
68
end
69
69
RUBY
@@ -73,7 +73,7 @@ def method_name
73
73
it 'registers an offense for a `define_method` with numblock' do
74
74
expect_offense ( <<~RUBY )
75
75
define_method :method_name do
76
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<1, 0, 0> 1/0]
76
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<1, 0, 0> 1/0]
77
77
x = _1
78
78
end
79
79
RUBY
@@ -84,7 +84,7 @@ def method_name
84
84
it 'registers an offense for a `define_method` with itblock' do
85
85
expect_offense ( <<~RUBY )
86
86
define_method :method_name do
87
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<1, 0, 0> 1/0]
87
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<1, 0, 0> 1/0]
88
88
x = it
89
89
end
90
90
RUBY
@@ -94,7 +94,7 @@ def method_name
94
94
it 'treats safe navigation method calls like regular method calls + a condition' do
95
95
expect_offense ( <<~RUBY )
96
96
def method_name
97
- ^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<0, 2, 1> 2.24/0]
97
+ ^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<0, 2, 1> 2.24/0]
98
98
object&.do_something
99
99
end
100
100
RUBY
@@ -104,7 +104,7 @@ def method_name
104
104
it 'registers an offense for an assignment of a local variable' do
105
105
offenses = expect_offense ( <<~RUBY )
106
106
def method_name
107
- ^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [<1, 0, 0> 1/0]
107
+ ^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [<1, 0, 0> 1/0]
108
108
x = 1
109
109
end
110
110
RUBY
@@ -177,7 +177,7 @@ def self.foo
177
177
it 'does not count repeated attributes' do
178
178
expect_offense ( <<~RUBY )
179
179
def foo
180
- ^^^^^^^ Assignment Branch Condition size for foo is too high. [<0, 1, 0> 1/0]
180
+ ^^^^^^^ Assignment Branch Condition size for ` foo` is too high. [<0, 1, 0> 1/0]
181
181
bar
182
182
self.bar
183
183
bar
@@ -192,7 +192,7 @@ def foo
192
192
it 'counts repeated attributes' do
193
193
expect_offense ( <<~RUBY )
194
194
def foo
195
- ^^^^^^^ Assignment Branch Condition size for foo is too high. [<0, 3, 0> 3/0]
195
+ ^^^^^^^ Assignment Branch Condition size for ` foo` is too high. [<0, 3, 0> 3/0]
196
196
bar
197
197
self.bar
198
198
bar
@@ -243,7 +243,7 @@ def method_name
243
243
244
244
expect_offense ( <<~RUBY )
245
245
def method_name
246
- ^^^^^^^^^^^^^^^ Assignment Branch Condition size for method_name is too high. [#{ presentation } ]
246
+ ^^^^^^^^^^^^^^^ Assignment Branch Condition size for ` method_name` is too high. [#{ presentation } ]
247
247
#{ code . join ( "\n " ) }
248
248
end
249
249
RUBY
0 commit comments