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

Commit 42f18ea

Browse files
author
ABaldwinHunter
committed
Highlight configuration docs in readup
Increase tuning option visibility.
1 parent 7132fc9 commit 42f18ea

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

config/contents/duplicated_code.md.erb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ Duplicated code can lead to software that is hard to understand and difficult to
66

77
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
88

9-
## Issue Mass
9+
## Tuning
1010

11-
Duplicated code has a calculated mass, which can be thought of as a measure of how much logic has been duplicated.
12-
This issue has a mass of `<%= mass %>`: if you would like to change the minimum mass that will be reported as an issue, please see the details in [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication).
11+
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
12+
13+
The threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
14+
15+
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
16+
17+
See [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.
1318

1419
## Refactorings
1520

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
{"path" => "foo.js", "lines" => { "begin" => 2, "end" => 2} },
3333
{"path" => "foo.js", "lines" => { "begin" => 3, "end" => 3} }
3434
])
35-
expect(json["content"]["body"]).to match /This issue has a mass of `11`/
3635
expect(json["fingerprint"]).to eq("c4d29200c20d02297c6f550ad2c87c15")
3736
end
3837

@@ -60,7 +59,6 @@
6059
{"path" => "foo.js", "lines" => { "begin" => 2, "end" => 2} },
6160
{"path" => "foo.js", "lines" => { "begin" => 3, "end" => 3} }
6261
])
63-
expect(json["content"]["body"]).to match /This issue has a mass of `11`/
6462
expect(json["fingerprint"]).to eq("d9dab8e4607e2a74da3b9eefb49eacec")
6563
end
6664

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
expect(json["other_locations"]).to eq([
4545
{"path" => "foo.php", "lines" => { "begin" => 10, "end" => 14} },
4646
])
47-
expect(json["content"]["body"]).to match /This issue has a mass of `11`/
4847
expect(json["fingerprint"]).to eq("8234e10d96fd6ef608085c22c91c9ab1")
4948
end
5049

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
{"path" => "foo.py", "lines" => { "begin" => 2, "end" => 2} },
3232
{"path" => "foo.py", "lines" => { "begin" => 3, "end" => 3} }
3333
])
34-
expect(json["content"]["body"]).to match /This issue has a mass of `6`/
3534
expect(json["fingerprint"]).to eq("3f3d34361bcaef98839d9da6ca9fcee4")
3635
end
3736

@@ -59,7 +58,6 @@
5958
{"path" => "foo.py", "lines" => { "begin" => 2, "end" => 2} },
6059
{"path" => "foo.py", "lines" => { "begin" => 3, "end" => 3} }
6160
])
62-
expect(json["content"]["body"]).to match /This issue has a mass of `6`/
6361
expect(json["fingerprint"]).to eq("019118ceed60bf40b35aad581aae1b02")
6462
end
6563

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def self.sub_degrees(str)
5656
expect(json["other_locations"]).to eq([
5757
{"path" => "foo.rb", "lines" => { "begin" => 9, "end" => 13} },
5858
])
59-
expect(json["content"]["body"]).to match /This issue has a mass of `18`/
6059
expect(json["fingerprint"]).to eq("b7e46d8f5164922678e48942e26100f2")
6160
end
6261

0 commit comments

Comments
 (0)