@@ -12,8 +12,8 @@ module CC::Engine
12
12
location . last_column = 99
13
13
14
14
offense = OpenStruct . new
15
- offense . cop_name = "Metrics/CyclomaticComplexity "
16
- offense . message = "Cyclomatic complexity for complex_method is too high [10/5] "
15
+ offense . cop_name = "Standard/SemanticBlocks "
16
+ offense . message = "Prefer `{...}` over `do...end` for functional blocks. "
17
17
offense . location = location
18
18
offense
19
19
end
@@ -23,9 +23,9 @@ module CC::Engine
23
23
attributes = JSON . parse ( issue . to_json )
24
24
25
25
expect ( attributes [ "type" ] ) . to eq ( "Issue" )
26
- expect ( attributes [ "check_name" ] ) . to eq ( "Rubocop/Metrics/CyclomaticComplexity " )
27
- expect ( attributes [ "description" ] ) . to eq ( "Cyclomatic complexity for complex_method is too high [10/5] " )
28
- expect ( attributes [ "categories" ] ) . to eq ( [ "Complexity " ] )
26
+ expect ( attributes [ "check_name" ] ) . to eq ( "Rubocop/Standard/SemanticBlocks " )
27
+ expect ( attributes [ "description" ] ) . to eq ( "Prefer `{...}` over `do...end` for functional blocks. " )
28
+ expect ( attributes [ "categories" ] ) . to eq ( [ "Style " ] )
29
29
expect ( attributes [ "remediation_points" ] ) . to eq ( 50_000 )
30
30
expect ( attributes [ "location" ] [ "path" ] ) . to eq ( "app/models/user.rb" )
31
31
expect ( attributes [ "location" ] [ "positions" ] [ "begin" ] [ "line" ] ) . to eq ( 10 )
@@ -36,22 +36,6 @@ module CC::Engine
36
36
"This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum."
37
37
)
38
38
end
39
-
40
- it "sets a fingerprint for method/class offenses" do
41
- offense . cop_name = "Metrics/AbcSize"
42
- issue = Issue . new ( offense , "app/models/user.rb" )
43
- attributes = JSON . parse ( issue . to_json )
44
-
45
- expect ( attributes ) . to have_key ( "fingerprint" )
46
- end
47
-
48
- it "does not set a fingerprint for other offenses" do
49
- offense . cop_name = "Style/AlignParameters"
50
- issue = Issue . new ( offense , "app/models/user.rb" )
51
- attributes = JSON . parse ( issue . to_json )
52
-
53
- expect ( attributes ) . not_to have_key ( "fingerprint" )
54
- end
55
39
end
56
40
57
41
describe "#remediation points" do
0 commit comments