Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Include mass in issue description #87

Merged
merged 1 commit into from
Jan 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/cc/engine/analyzers/violation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def fingerprint
def description
description = "#{check_name} found in #{occurrences} other location"
description += "s" if occurrences > 1
description += " (mass = #{mass})"
description
end

Expand Down
4 changes: 2 additions & 2 deletions spec/cc/engine/analyzers/javascript/main_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

expect(json["type"]).to eq("issue")
expect(json["check_name"]).to eq("Identical code")
expect(json["description"]).to eq("Identical code found in 2 other locations")
expect(json["description"]).to eq("Identical code found in 2 other locations (mass = 11)")
expect(json["categories"]).to eq(["Duplication"])
expect(json["location"]).to eq({
"path" => "foo.js",
Expand Down Expand Up @@ -50,7 +50,7 @@

expect(json["type"]).to eq("issue")
expect(json["check_name"]).to eq("Similar code")
expect(json["description"]).to eq("Similar code found in 2 other locations")
expect(json["description"]).to eq("Similar code found in 2 other locations (mass = 11)")
expect(json["categories"]).to eq(["Duplication"])
expect(json["location"]).to eq({
"path" => "foo.js",
Expand Down
2 changes: 1 addition & 1 deletion spec/cc/engine/analyzers/php/main_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

expect(json["type"]).to eq("issue")
expect(json["check_name"]).to eq("Identical code")
expect(json["description"]).to eq("Identical code found in 1 other location")
expect(json["description"]).to eq("Identical code found in 1 other location (mass = 11)")
expect(json["categories"]).to eq(["Duplication"])
expect(json["location"]).to eq({
"path" => "foo.php",
Expand Down
4 changes: 2 additions & 2 deletions spec/cc/engine/analyzers/python/main_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

expect(json["type"]).to eq("issue")
expect(json["check_name"]).to eq("Identical code")
expect(json["description"]).to eq("Identical code found in 2 other locations")
expect(json["description"]).to eq("Identical code found in 2 other locations (mass = 6)")
expect(json["categories"]).to eq(["Duplication"])
expect(json["location"]).to eq({
"path" => "foo.py",
Expand Down Expand Up @@ -50,7 +50,7 @@

expect(json["type"]).to eq("issue")
expect(json["check_name"]).to eq("Similar code")
expect(json["description"]).to eq("Similar code found in 2 other locations")
expect(json["description"]).to eq("Similar code found in 2 other locations (mass = 6)")
expect(json["categories"]).to eq(["Duplication"])
expect(json["location"]).to eq({
"path" => "foo.py",
Expand Down
2 changes: 1 addition & 1 deletion spec/cc/engine/analyzers/ruby/main_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module CC::Engine::Analyzers

expect(json["type"]).to eq("issue")
expect(json["check_name"]).to eq("Similar code")
expect(json["description"]).to eq("Similar code found in 1 other location")
expect(json["description"]).to eq("Similar code found in 1 other location (mass = 18)")
expect(json["categories"]).to eq(["Duplication"])
expect(json["location"]).to eq({
"path" => "foo.rb",
Expand Down
2 changes: 1 addition & 1 deletion spec/cc/engine/analyzers/violations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module CC::Engine::Analyzers

expect(first_formatted[:type]).to eq("issue")
expect(first_formatted[:check_name]).to eq("Identical code")
expect(first_formatted[:description]).to eq("Identical code found in 2 other locations")
expect(first_formatted[:description]).to eq("Identical code found in 2 other locations (mass = 18)")
expect(first_formatted[:categories]).to eq(["Duplication"])
expect(first_formatted[:remediation_points]).to eq(30)
expect(first_formatted[:location]).to eq({:path=>"file.rb", :lines=>{:begin=>1, :end=>5}})
Expand Down