Skip to content

Commit c6165cd

Browse files
author
Ashley Baldwin-Hunter
committed
Merge pull request #87 from codeclimate/abh-increase-mass-visibility
Include mass in issue description
2 parents 8a3234f + 8a4ae61 commit c6165cd

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

lib/cc/engine/analyzers/violation.rb

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def fingerprint
9393
def description
9494
description = "#{check_name} found in #{occurrences} other location"
9595
description += "s" if occurrences > 1
96+
description += " (mass = #{mass})"
9697
description
9798
end
9899

spec/cc/engine/analyzers/javascript/main_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
expect(json["type"]).to eq("issue")
2424
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)")
2626
expect(json["categories"]).to eq(["Duplication"])
2727
expect(json["location"]).to eq({
2828
"path" => "foo.js",
@@ -50,7 +50,7 @@
5050

5151
expect(json["type"]).to eq("issue")
5252
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)")
5454
expect(json["categories"]).to eq(["Duplication"])
5555
expect(json["location"]).to eq({
5656
"path" => "foo.js",

spec/cc/engine/analyzers/php/main_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
expect(json["type"]).to eq("issue")
3737
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)")
3939
expect(json["categories"]).to eq(["Duplication"])
4040
expect(json["location"]).to eq({
4141
"path" => "foo.php",

spec/cc/engine/analyzers/python/main_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
expect(json["type"]).to eq("issue")
2424
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)")
2626
expect(json["categories"]).to eq(["Duplication"])
2727
expect(json["location"]).to eq({
2828
"path" => "foo.py",
@@ -50,7 +50,7 @@
5050

5151
expect(json["type"]).to eq("issue")
5252
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)")
5454
expect(json["categories"]).to eq(["Duplication"])
5555
expect(json["location"]).to eq({
5656
"path" => "foo.py",

spec/cc/engine/analyzers/ruby/main_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module CC::Engine::Analyzers
3434

3535
expect(json["type"]).to eq("issue")
3636
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)")
3838
expect(json["categories"]).to eq(["Duplication"])
3939
expect(json["location"]).to eq({
4040
"path" => "foo.rb",

spec/cc/engine/analyzers/violations_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module CC::Engine::Analyzers
3535

3636
expect(first_formatted[:type]).to eq("issue")
3737
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)")
3939
expect(first_formatted[:categories]).to eq(["Duplication"])
4040
expect(first_formatted[:remediation_points]).to eq(30)
4141
expect(first_formatted[:location]).to eq({:path=>"file.rb", :lines=>{:begin=>1, :end=>5}})

0 commit comments

Comments
 (0)