File tree 6 files changed +8
-7
lines changed
6 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ def fingerprint
93
93
def description
94
94
description = "#{ check_name } found in #{ occurrences } other location"
95
95
description += "s" if occurrences > 1
96
+ description += " (mass = #{ mass } )"
96
97
description
97
98
end
98
99
Original file line number Diff line number Diff line change 22
22
23
23
expect ( json [ "type" ] ) . to eq ( "issue" )
24
24
expect ( json [ "check_name" ] ) . to eq ( "Identical code" )
25
- expect ( json [ "description" ] ) . to eq ( "Identical code found in 2 other locations" )
25
+ expect ( json [ "description" ] ) . to eq ( "Identical code found in 2 other locations (mass = 11) " )
26
26
expect ( json [ "categories" ] ) . to eq ( [ "Duplication" ] )
27
27
expect ( json [ "location" ] ) . to eq ( {
28
28
"path" => "foo.js" ,
50
50
51
51
expect ( json [ "type" ] ) . to eq ( "issue" )
52
52
expect ( json [ "check_name" ] ) . to eq ( "Similar code" )
53
- expect ( json [ "description" ] ) . to eq ( "Similar code found in 2 other locations" )
53
+ expect ( json [ "description" ] ) . to eq ( "Similar code found in 2 other locations (mass = 11) " )
54
54
expect ( json [ "categories" ] ) . to eq ( [ "Duplication" ] )
55
55
expect ( json [ "location" ] ) . to eq ( {
56
56
"path" => "foo.js" ,
Original file line number Diff line number Diff line change 35
35
36
36
expect ( json [ "type" ] ) . to eq ( "issue" )
37
37
expect ( json [ "check_name" ] ) . to eq ( "Identical code" )
38
- expect ( json [ "description" ] ) . to eq ( "Identical code found in 1 other location" )
38
+ expect ( json [ "description" ] ) . to eq ( "Identical code found in 1 other location (mass = 11) " )
39
39
expect ( json [ "categories" ] ) . to eq ( [ "Duplication" ] )
40
40
expect ( json [ "location" ] ) . to eq ( {
41
41
"path" => "foo.php" ,
Original file line number Diff line number Diff line change 22
22
23
23
expect ( json [ "type" ] ) . to eq ( "issue" )
24
24
expect ( json [ "check_name" ] ) . to eq ( "Identical code" )
25
- expect ( json [ "description" ] ) . to eq ( "Identical code found in 2 other locations" )
25
+ expect ( json [ "description" ] ) . to eq ( "Identical code found in 2 other locations (mass = 6) " )
26
26
expect ( json [ "categories" ] ) . to eq ( [ "Duplication" ] )
27
27
expect ( json [ "location" ] ) . to eq ( {
28
28
"path" => "foo.py" ,
50
50
51
51
expect ( json [ "type" ] ) . to eq ( "issue" )
52
52
expect ( json [ "check_name" ] ) . to eq ( "Similar code" )
53
- expect ( json [ "description" ] ) . to eq ( "Similar code found in 2 other locations" )
53
+ expect ( json [ "description" ] ) . to eq ( "Similar code found in 2 other locations (mass = 6) " )
54
54
expect ( json [ "categories" ] ) . to eq ( [ "Duplication" ] )
55
55
expect ( json [ "location" ] ) . to eq ( {
56
56
"path" => "foo.py" ,
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ module CC::Engine::Analyzers
34
34
35
35
expect ( json [ "type" ] ) . to eq ( "issue" )
36
36
expect ( json [ "check_name" ] ) . to eq ( "Similar code" )
37
- expect ( json [ "description" ] ) . to eq ( "Similar code found in 1 other location" )
37
+ expect ( json [ "description" ] ) . to eq ( "Similar code found in 1 other location (mass = 18) " )
38
38
expect ( json [ "categories" ] ) . to eq ( [ "Duplication" ] )
39
39
expect ( json [ "location" ] ) . to eq ( {
40
40
"path" => "foo.rb" ,
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ module CC::Engine::Analyzers
35
35
36
36
expect ( first_formatted [ :type ] ) . to eq ( "issue" )
37
37
expect ( first_formatted [ :check_name ] ) . to eq ( "Identical code" )
38
- expect ( first_formatted [ :description ] ) . to eq ( "Identical code found in 2 other locations" )
38
+ expect ( first_formatted [ :description ] ) . to eq ( "Identical code found in 2 other locations (mass = 18) " )
39
39
expect ( first_formatted [ :categories ] ) . to eq ( [ "Duplication" ] )
40
40
expect ( first_formatted [ :remediation_points ] ) . to eq ( 30 )
41
41
expect ( first_formatted [ :location ] ) . to eq ( { :path => "file.rb" , :lines => { :begin => 1 , :end => 5 } } )
You can’t perform that action at this time.
0 commit comments